Skip to content

Commit d5b8755

Browse files
committed
Fixed map_clone clippy warnings
1 parent 1043543 commit d5b8755

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

vm/src/compile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ impl Compiler {
163163
_ => {
164164
self.emit(Instruction::Import {
165165
name: module.clone(),
166-
symbol: symbol.clone().map(|s| s.clone()),
166+
symbol: symbol.clone(),
167167
});
168168
self.emit(Instruction::StoreName {
169169
name: match alias {

vm/src/pyobject.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ pub trait AttributeProtocol {
736736
fn class_get_item(class: &PyObjectRef, attr_name: &str) -> Option<PyObjectRef> {
737737
let class = class.borrow();
738738
match class.payload {
739-
PyObjectPayload::Class { ref dict, .. } => dict.borrow().get(attr_name).map(|v| v.clone()),
739+
PyObjectPayload::Class { ref dict, .. } => dict.borrow().get(attr_name).cloned(),
740740
_ => panic!("Only classes should be in MRO!"),
741741
}
742742
}
@@ -766,7 +766,7 @@ impl AttributeProtocol for PyObjectRef {
766766
None
767767
}
768768
PyObjectPayload::Instance { ref dict } => {
769-
dict.borrow().get(attr_name).map(|v| v.clone())
769+
dict.borrow().get(attr_name).cloned()
770770
}
771771
_ => None,
772772
}

0 commit comments

Comments
 (0)