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() {
774774 let key = "hello there" ;
775775 let value = "value goes here" ;
776776 assert ! ( a. is_empty( ) ) ;
777- a. insert ( key. clone ( ) , value. clone ( ) ) ;
777+ a. insert ( key, value) ;
778778 assert_eq ! ( a. len( ) , 1 ) ;
779779 assert_eq ! ( a[ key] , value) ;
780780
781- match a. entry ( key. clone ( ) ) {
781+ match a. entry ( key) {
782782 Vacant ( _) => panic ! ( ) ,
783783 Occupied ( e) => assert_eq ! ( key, * e. key( ) ) ,
784784 }
@@ -793,11 +793,11 @@ fn test_vacant_entry_key() {
793793 let value = "value goes here" ;
794794
795795 assert ! ( a. is_empty( ) ) ;
796- match a. entry ( key. clone ( ) ) {
796+ match a. entry ( key) {
797797 Occupied ( _) => panic ! ( ) ,
798798 Vacant ( e) => {
799799 assert_eq ! ( key, * e. key( ) ) ;
800- e. insert ( value. clone ( ) ) ;
800+ e. insert ( value) ;
801801 }
802802 }
803803 assert_eq ! ( a. len( ) , 1 ) ;
You can’t perform that action at this time.
0 commit comments