File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
library/alloc/src/collections/btree/map Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1801,11 +1801,11 @@ fn test_occupied_entry_key() {
1801
1801
let key = "hello there" ;
1802
1802
let value = "value goes here" ;
1803
1803
assert ! ( a. is_empty( ) ) ;
1804
- a. insert ( key. clone ( ) , value. clone ( ) ) ;
1804
+ a. insert ( key, value) ;
1805
1805
assert_eq ! ( a. len( ) , 1 ) ;
1806
1806
assert_eq ! ( a[ key] , value) ;
1807
1807
1808
- match a. entry ( key. clone ( ) ) {
1808
+ match a. entry ( key) {
1809
1809
Vacant ( _) => panic ! ( ) ,
1810
1810
Occupied ( e) => assert_eq ! ( key, * e. key( ) ) ,
1811
1811
}
@@ -1821,11 +1821,11 @@ fn test_vacant_entry_key() {
1821
1821
let value = "value goes here" ;
1822
1822
1823
1823
assert ! ( a. is_empty( ) ) ;
1824
- match a. entry ( key. clone ( ) ) {
1824
+ match a. entry ( key) {
1825
1825
Occupied ( _) => panic ! ( ) ,
1826
1826
Vacant ( e) => {
1827
1827
assert_eq ! ( key, * e. key( ) ) ;
1828
- e. insert ( value. clone ( ) ) ;
1828
+ e. insert ( value) ;
1829
1829
}
1830
1830
}
1831
1831
assert_eq ! ( a. len( ) , 1 ) ;
You can’t perform that action at this time.
0 commit comments