File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
library/std/src/collections/hash/map Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -774,11 +774,11 @@ fn test_occupied_entry_key() {
774
774
let key = "hello there" ;
775
775
let value = "value goes here" ;
776
776
assert ! ( a. is_empty( ) ) ;
777
- a. insert ( key. clone ( ) , value. clone ( ) ) ;
777
+ a. insert ( key, value) ;
778
778
assert_eq ! ( a. len( ) , 1 ) ;
779
779
assert_eq ! ( a[ key] , value) ;
780
780
781
- match a. entry ( key. clone ( ) ) {
781
+ match a. entry ( key) {
782
782
Vacant ( _) => panic ! ( ) ,
783
783
Occupied ( e) => assert_eq ! ( key, * e. key( ) ) ,
784
784
}
@@ -793,11 +793,11 @@ fn test_vacant_entry_key() {
793
793
let value = "value goes here" ;
794
794
795
795
assert ! ( a. is_empty( ) ) ;
796
- match a. entry ( key. clone ( ) ) {
796
+ match a. entry ( key) {
797
797
Occupied ( _) => panic ! ( ) ,
798
798
Vacant ( e) => {
799
799
assert_eq ! ( key, * e. key( ) ) ;
800
- e. insert ( value. clone ( ) ) ;
800
+ e. insert ( value) ;
801
801
}
802
802
}
803
803
assert_eq ! ( a. len( ) , 1 ) ;
You can’t perform that action at this time.
0 commit comments