diff --git a/Cargo.toml b/Cargo.toml index 51eea51d..ca6b77df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -71,6 +71,7 @@ negative_feature_names = "warn" path_buf_push_overwrite = "warn" ptr_as_ptr = "warn" rc_mutex = "warn" +redundant_clone = "warn" redundant_feature_names = "warn" ref_option_ref = "warn" rest_pat_in_fully_bound_structs = "warn" diff --git a/crates/toml/tests/serde/general.rs b/crates/toml/tests/serde/general.rs index 48a28e10..899eeb06 100644 --- a/crates/toml/tests/serde/general.rs +++ b/crates/toml/tests/serde/general.rs @@ -1221,7 +1221,7 @@ Foo { ); println!("Value::try_from(literal)"); assert_data_eq!( - toml::Value::try_from(literal.clone()) + toml::Value::try_from(literal) .unwrap_err() .to_string(), str!["u64 value was too large"].raw() @@ -1284,7 +1284,7 @@ Foo { ); println!("Value::try_from(literal)"); assert_data_eq!( - toml::Value::try_from(literal.clone()) + toml::Value::try_from(literal) .unwrap_err() .to_string(), str!["i128 is not supported"].raw() @@ -1347,7 +1347,7 @@ Foo { ); println!("Value::try_from(literal)"); assert_data_eq!( - toml::Value::try_from(literal.clone()) + toml::Value::try_from(literal) .unwrap_err() .to_string(), str!["i128 is not supported"].raw() @@ -1410,7 +1410,7 @@ Foo { ); println!("Value::try_from(literal)"); assert_data_eq!( - toml::Value::try_from(literal.clone()) + toml::Value::try_from(literal) .unwrap_err() .to_string(), str!["u128 is not supported"].raw() diff --git a/crates/toml_edit/src/inline_table.rs b/crates/toml_edit/src/inline_table.rs index 10e7ffef..36782664 100644 --- a/crates/toml_edit/src/inline_table.rs +++ b/crates/toml_edit/src/inline_table.rs @@ -397,7 +397,7 @@ impl InlineTable { use indexmap::map::MutableEntryKey; let key = Key::new(key); let value = Item::Value(value); - match self.items.entry(key.clone()) { + match self.items.entry(key) { indexmap::map::Entry::Occupied(mut entry) => { entry.key_mut().fmt(); let old = std::mem::replace(entry.get_mut(), value); diff --git a/crates/toml_edit/src/table.rs b/crates/toml_edit/src/table.rs index 85dac1be..13568fc4 100644 --- a/crates/toml_edit/src/table.rs +++ b/crates/toml_edit/src/table.rs @@ -433,7 +433,7 @@ impl Table { pub fn insert(&mut self, key: &str, item: Item) -> Option { use indexmap::map::MutableEntryKey; let key = Key::new(key); - match self.items.entry(key.clone()) { + match self.items.entry(key) { indexmap::map::Entry::Occupied(mut entry) => { entry.key_mut().fmt(); let old = std::mem::replace(entry.get_mut(), item);