Bad code snippet:
pub fn new(endpoint: &str, credential: Arc<(dyn TokenCredential)>, options: Option<SecretClientOptions>) -> Result<Self> {}
What it should do:
The APIView comment cites the Rust AsRef parameter guideline and suggests changing endpoint to impl AsRef<str>, but that guideline is out of date and the referenced #rust-parameters-asref section no longer exists. The documentation/guideline should be updated rather than treating this as a current API requirement.
Good code snippet:
pub fn new(endpoint: &str, credential: Arc<dyn TokenCredential>, options: Option<SecretClientOptions>) -> Result<Self> {}
Bad code snippet:
What it should do:
The APIView comment cites the Rust
AsRefparameter guideline and suggests changingendpointtoimpl AsRef<str>, but that guideline is out of date and the referenced#rust-parameters-asrefsection no longer exists. The documentation/guideline should be updated rather than treating this as a current API requirement.Good code snippet: