clippy fix: needless borrow

See:
https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
This commit is contained in:
Lukas Wagner 2023-08-08 10:01:42 +02:00 committed by Wolfgang Bumiller
parent b4b186c544
commit 81ca4ae6a1
5 changed files with 9 additions and 9 deletions

View File

@ -221,7 +221,7 @@ impl OpenIdAuthenticator {
private_auth_state: &PrivateAuthState,
) -> Result<Value, Error> {
let (id_token_claims, userinfo_claims) =
self.verify_authorization_code(&code, &private_auth_state)?;
self.verify_authorization_code(code, private_auth_state)?;
let mut data = serde_json::to_value(id_token_claims)?;

View File

@ -946,7 +946,7 @@ impl Formatted {
let result = if api_method.protected
&& rpcenv.env_type == RpcEnvironmentType::PUBLIC
{
proxy_protected_request(api_method, parts, body, &peer).await
proxy_protected_request(api_method, parts, body, peer).await
} else {
handle_api_request(rpcenv, api_method, formatter, parts, body, uri_param).await
};
@ -1051,7 +1051,7 @@ impl Unformatted {
let result = if api_method.protected
&& rpcenv.env_type == RpcEnvironmentType::PUBLIC
{
proxy_protected_request(api_method, parts, body, &peer).await
proxy_protected_request(api_method, parts, body, peer).await
} else {
handle_unformatted_api_request(rpcenv, api_method, parts, body, uri_param).await
};

View File

@ -93,7 +93,7 @@ where
<B as ToOwned>::Owned: Borrow<B>,
{
fn as_ref(&self) -> &B {
&self
self
}
}

View File

@ -588,7 +588,7 @@ impl<'de, 'i> de::MapAccess<'de> for MapAccess<'de, 'i> {
let (key, schema) = match key {
Some(key) => {
let schema = self.schema.lookup(&key);
let schema = self.schema.lookup(key);
let key = match str_slice_to_range(&self.input, key) {
None => Cow::Owned(key.to_string()),
Some(range) => match &self.input {

View File

@ -36,12 +36,12 @@ impl StdError for Error {
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Generic(e) => f.write_str(&e),
Error::Decode(m, _e) => f.write_str(&m),
Error::Ssl(m, _e) => f.write_str(&m),
Error::Generic(e) => f.write_str(e),
Error::Decode(m, _e) => f.write_str(m),
Error::Ssl(m, _e) => f.write_str(m),
Error::UnsupportedAlgorithm(a) => write!(f, "unsupported algorithm: '{a}'"),
Error::UnknownParameter(p) => write!(f, "unknown otpauth uri parameter: '{p}'"),
Error::BadParameter(m, _e) => f.write_str(&m),
Error::BadParameter(m, _e) => f.write_str(m),
}
}
}