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 @@ -1633,11 +1633,11 @@ fn test_occupied_entry_key() {
1633
1633
let key = "hello there" ;
1634
1634
let value = "value goes here" ;
1635
1635
assert ! ( a. is_empty( ) ) ;
1636
- a. insert ( key. clone ( ) , value. clone ( ) ) ;
1636
+ a. insert ( key, value) ;
1637
1637
assert_eq ! ( a. len( ) , 1 ) ;
1638
1638
assert_eq ! ( a[ key] , value) ;
1639
1639
1640
- match a. entry ( key. clone ( ) ) {
1640
+ match a. entry ( key) {
1641
1641
Vacant ( _) => panic ! ( ) ,
1642
1642
Occupied ( e) => assert_eq ! ( key, * e. key( ) ) ,
1643
1643
}
@@ -1653,11 +1653,11 @@ fn test_vacant_entry_key() {
1653
1653
let value = "value goes here" ;
1654
1654
1655
1655
assert ! ( a. is_empty( ) ) ;
1656
- match a. entry ( key. clone ( ) ) {
1656
+ match a. entry ( key) {
1657
1657
Occupied ( _) => panic ! ( ) ,
1658
1658
Vacant ( e) => {
1659
1659
assert_eq ! ( key, * e. key( ) ) ;
1660
- e. insert ( value. clone ( ) ) ;
1660
+ e. insert ( value) ;
1661
1661
}
1662
1662
}
1663
1663
assert_eq ! ( a. len( ) , 1 ) ;
You can’t perform that action at this time.
0 commit comments