mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-09 22:59:59 +00:00
chore(lint): clippy rules redundant_clone (#2554)
This commit is contained in:
@@ -450,7 +450,7 @@ where
|
||||
|
||||
self.cache.policy_docs.store(Arc::new(cache));
|
||||
|
||||
let items: Vec<_> = m.into_iter().map(|(k, v)| (k, v.policy.clone())).collect();
|
||||
let items: Vec<_> = m.into_iter().map(|(k, v)| (k, v.policy)).collect();
|
||||
|
||||
let futures: Vec<_> = items.iter().map(|(_, policy)| policy.match_resource(bucket_name)).collect();
|
||||
|
||||
@@ -516,7 +516,7 @@ where
|
||||
|
||||
self.cache.policy_docs.store(Arc::new(cache));
|
||||
|
||||
let items: Vec<_> = m.into_iter().map(|(k, v)| (k, v.clone())).collect();
|
||||
let items: Vec<_> = m.into_iter().collect();
|
||||
|
||||
let futures: Vec<_> = items
|
||||
.iter()
|
||||
@@ -1876,7 +1876,7 @@ fn set_default_canned_policies(policies: &mut HashMap<String, PolicyDoc>) {
|
||||
|
||||
pub fn get_token_signing_key() -> Option<String> {
|
||||
if let Some(s) = get_global_action_cred() {
|
||||
Some(s.secret_key.clone())
|
||||
Some(s.secret_key)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
@@ -2201,7 +2201,7 @@ mod tests {
|
||||
name: Some("service-account-name".to_string()),
|
||||
description: Some("Updated service account".to_string()),
|
||||
expiration: None,
|
||||
session_policy: Some(policy.clone()),
|
||||
session_policy: Some(policy),
|
||||
};
|
||||
|
||||
assert_eq!(opts.secret_key, Some("new-secret-key".to_string()));
|
||||
|
||||
@@ -163,7 +163,7 @@ impl ObjectStore {
|
||||
let password = if !cred.access_key.is_empty() && !cred.secret_key.is_empty() {
|
||||
format!("{}:{}", cred.access_key, cred.secret_key).into_bytes()
|
||||
} else {
|
||||
cred.secret_key.clone().into_bytes()
|
||||
cred.secret_key.into_bytes()
|
||||
};
|
||||
let en = rustfs_crypto::encrypt_stream_io(&password, data)?;
|
||||
Ok(en)
|
||||
|
||||
@@ -967,7 +967,7 @@ impl<T: Store> IamSys<T> {
|
||||
let (effective_groups, groups_source) = match args.groups.as_ref() {
|
||||
Some(g) if !g.is_empty() => (args.groups.clone(), "args"),
|
||||
_ => match self.store.get_user(parent_user).await {
|
||||
Some(u) => (u.credentials.groups.clone(), "parent_user_credentials"),
|
||||
Some(u) => (u.credentials.groups, "parent_user_credentials"),
|
||||
None => {
|
||||
tracing::warn!(
|
||||
parent_user = %parent_user,
|
||||
|
||||
Reference in New Issue
Block a user