@@ -105,7 +105,7 @@ pub(super) fn lower_body(
105105 let is_mutable =
106106 self_param_syn. mut_token ( ) . is_some ( ) && self_param_syn. amp_token ( ) . is_none ( ) ;
107107 let binding_id: la_arena:: Idx < Binding > = collector. alloc_binding (
108- Name :: new_symbol_root ( sym:: self_. clone ( ) ) ,
108+ Name :: new_symbol_root ( sym:: self_) ,
109109 BindingAnnotation :: new ( is_mutable, false ) ,
110110 ) ;
111111 self_param = Some ( binding_id) ;
@@ -137,7 +137,7 @@ pub(super) fn lower_body(
137137 let is_mutable =
138138 self_param_syn. mut_token ( ) . is_some ( ) && self_param_syn. amp_token ( ) . is_none ( ) ;
139139 let binding_id: la_arena:: Idx < Binding > = collector. alloc_binding (
140- Name :: new_symbol_root ( sym:: self_. clone ( ) ) ,
140+ Name :: new_symbol_root ( sym:: self_) ,
141141 BindingAnnotation :: new ( is_mutable, false ) ,
142142 ) ;
143143 let hygiene = self_param_syn
@@ -322,7 +322,7 @@ pub(crate) fn lower_function(
322322 Some ( ty) => collector. lower_type_ref ( ty, & mut impl_trait_lower_fn) ,
323323 None => {
324324 let self_type = collector. alloc_type_ref_desugared ( TypeRef :: Path (
325- Name :: new_symbol_root ( sym:: Self_ . clone ( ) ) . into ( ) ,
325+ Name :: new_symbol_root ( sym:: Self_ ) . into ( ) ,
326326 ) ) ;
327327 let lifetime = param
328328 . lifetime ( )
@@ -375,7 +375,7 @@ pub(crate) fn lower_function(
375375 let mut generic_args: Vec < _ > =
376376 std:: iter:: repeat_n ( None , path. segments ( ) . len ( ) - 1 ) . collect ( ) ;
377377 let binding = AssociatedTypeBinding {
378- name : Name :: new_symbol_root ( sym:: Output . clone ( ) ) ,
378+ name : Name :: new_symbol_root ( sym:: Output ) ,
379379 args : None ,
380380 type_ref : Some (
381381 return_type
@@ -631,7 +631,7 @@ impl ExprCollector<'_> {
631631 match abi. abi_string ( ) {
632632 Some ( tok) => Symbol :: intern ( tok. text_without_quotes ( ) ) ,
633633 // `extern` default to be `extern "C"`.
634- _ => sym:: C . clone ( ) ,
634+ _ => sym:: C ,
635635 }
636636 }
637637
@@ -760,7 +760,7 @@ impl ExprCollector<'_> {
760760 let bindings = if let Some ( ret_type) = ret_type {
761761 let type_ref = self . lower_type_ref_opt ( ret_type. ty ( ) , impl_trait_lower_fn) ;
762762 Box :: new ( [ AssociatedTypeBinding {
763- name : Name :: new_symbol_root ( sym:: Output . clone ( ) ) ,
763+ name : Name :: new_symbol_root ( sym:: Output ) ,
764764 args : None ,
765765 type_ref : Some ( type_ref) ,
766766 bounds : Box :: default ( ) ,
@@ -769,7 +769,7 @@ impl ExprCollector<'_> {
769769 // -> ()
770770 let type_ref = self . alloc_type_ref_desugared ( TypeRef :: unit ( ) ) ;
771771 Box :: new ( [ AssociatedTypeBinding {
772- name : Name :: new_symbol_root ( sym:: Output . clone ( ) ) ,
772+ name : Name :: new_symbol_root ( sym:: Output ) ,
773773 args : None ,
774774 type_ref : Some ( type_ref) ,
775775 bounds : Box :: default ( ) ,
@@ -2804,12 +2804,12 @@ impl ExprCollector<'_> {
28042804 let new_v1_formatted = LangItem :: FormatArguments . ty_rel_path (
28052805 self . db ,
28062806 self . module . krate ( ) ,
2807- Name :: new_symbol_root ( sym:: new_v1_formatted. clone ( ) ) ,
2807+ Name :: new_symbol_root ( sym:: new_v1_formatted) ,
28082808 ) ;
28092809 let unsafe_arg_new = LangItem :: FormatUnsafeArg . ty_rel_path (
28102810 self . db ,
28112811 self . module . krate ( ) ,
2812- Name :: new_symbol_root ( sym:: new. clone ( ) ) ,
2812+ Name :: new_symbol_root ( sym:: new) ,
28132813 ) ;
28142814 let new_v1_formatted =
28152815 self . alloc_expr_desugared ( new_v1_formatted. map_or ( Expr :: Missing , Expr :: Path ) ) ;
@@ -2924,20 +2924,15 @@ impl ExprCollector<'_> {
29242924 Some ( BuiltinUint :: U32 ) ,
29252925 ) ) ) ;
29262926
2927- let position = RecordLitField {
2928- name : Name :: new_symbol_root ( sym:: position. clone ( ) ) ,
2929- expr : position,
2930- } ;
2931- let flags =
2932- RecordLitField { name : Name :: new_symbol_root ( sym:: flags. clone ( ) ) , expr : flags } ;
2927+ let position =
2928+ RecordLitField { name : Name :: new_symbol_root ( sym:: position) , expr : position } ;
2929+ let flags = RecordLitField { name : Name :: new_symbol_root ( sym:: flags) , expr : flags } ;
29332930 let precision = RecordLitField {
2934- name : Name :: new_symbol_root ( sym:: precision. clone ( ) ) ,
2931+ name : Name :: new_symbol_root ( sym:: precision) ,
29352932 expr : precision_expr,
29362933 } ;
2937- let width = RecordLitField {
2938- name : Name :: new_symbol_root ( sym:: width. clone ( ) ) ,
2939- expr : width_expr,
2940- } ;
2934+ let width =
2935+ RecordLitField { name : Name :: new_symbol_root ( sym:: width) , expr : width_expr } ;
29412936 self . alloc_expr_desugared ( Expr :: RecordLit {
29422937 path : LangItem :: FormatPlaceholder . path ( self . db , self . module . krate ( ) ) . map ( Box :: new) ,
29432938 fields : Box :: new ( [ position, flags, precision, width] ) ,
@@ -2948,7 +2943,7 @@ impl ExprCollector<'_> {
29482943 let format_placeholder_new = LangItem :: FormatPlaceholder . ty_rel_path (
29492944 self . db ,
29502945 self . module . krate ( ) ,
2951- Name :: new_symbol_root ( sym:: new. clone ( ) ) ,
2946+ Name :: new_symbol_root ( sym:: new) ,
29522947 ) ;
29532948 match format_placeholder_new {
29542949 Some ( path) => self . alloc_expr_desugared ( Expr :: Path ( path) ) ,
@@ -2972,10 +2967,10 @@ impl ExprCollector<'_> {
29722967 self . db ,
29732968 self . module . krate ( ) ,
29742969 match alignment {
2975- Some ( FormatAlignment :: Left ) => Name :: new_symbol_root ( sym:: Left . clone ( ) ) ,
2976- Some ( FormatAlignment :: Right ) => Name :: new_symbol_root ( sym:: Right . clone ( ) ) ,
2977- Some ( FormatAlignment :: Center ) => Name :: new_symbol_root ( sym:: Center . clone ( ) ) ,
2978- None => Name :: new_symbol_root ( sym:: Unknown . clone ( ) ) ,
2970+ Some ( FormatAlignment :: Left ) => Name :: new_symbol_root ( sym:: Left ) ,
2971+ Some ( FormatAlignment :: Right ) => Name :: new_symbol_root ( sym:: Right ) ,
2972+ Some ( FormatAlignment :: Center ) => Name :: new_symbol_root ( sym:: Center ) ,
2973+ None => Name :: new_symbol_root ( sym:: Unknown ) ,
29792974 } ,
29802975 ) ;
29812976 match align {
@@ -3024,7 +3019,7 @@ impl ExprCollector<'_> {
30243019 let count_is = match LangItem :: FormatCount . ty_rel_path (
30253020 self . db ,
30263021 self . module . krate ( ) ,
3027- Name :: new_symbol_root ( sym:: Is . clone ( ) ) ,
3022+ Name :: new_symbol_root ( sym:: Is ) ,
30283023 ) {
30293024 Some ( count_is) => self . alloc_expr_desugared ( Expr :: Path ( count_is) ) ,
30303025 None => self . missing_expr ( ) ,
@@ -3042,7 +3037,7 @@ impl ExprCollector<'_> {
30423037 let count_param = match LangItem :: FormatCount . ty_rel_path (
30433038 self . db ,
30443039 self . module . krate ( ) ,
3045- Name :: new_symbol_root ( sym:: Param . clone ( ) ) ,
3040+ Name :: new_symbol_root ( sym:: Param ) ,
30463041 ) {
30473042 Some ( count_param) => self . alloc_expr_desugared ( Expr :: Path ( count_param) ) ,
30483043 None => self . missing_expr ( ) ,
@@ -3060,7 +3055,7 @@ impl ExprCollector<'_> {
30603055 None => match LangItem :: FormatCount . ty_rel_path (
30613056 self . db ,
30623057 self . module . krate ( ) ,
3063- Name :: new_symbol_root ( sym:: Implied . clone ( ) ) ,
3058+ Name :: new_symbol_root ( sym:: Implied ) ,
30643059 ) {
30653060 Some ( count_param) => self . alloc_expr_desugared ( Expr :: Path ( count_param) ) ,
30663061 None => self . missing_expr ( ) ,
@@ -3083,16 +3078,16 @@ impl ExprCollector<'_> {
30833078 self . db ,
30843079 self . module . krate ( ) ,
30853080 Name :: new_symbol_root ( match ty {
3086- Format ( Display ) => sym:: new_display. clone ( ) ,
3087- Format ( Debug ) => sym:: new_debug. clone ( ) ,
3088- Format ( LowerExp ) => sym:: new_lower_exp. clone ( ) ,
3089- Format ( UpperExp ) => sym:: new_upper_exp. clone ( ) ,
3090- Format ( Octal ) => sym:: new_octal. clone ( ) ,
3091- Format ( Pointer ) => sym:: new_pointer. clone ( ) ,
3092- Format ( Binary ) => sym:: new_binary. clone ( ) ,
3093- Format ( LowerHex ) => sym:: new_lower_hex. clone ( ) ,
3094- Format ( UpperHex ) => sym:: new_upper_hex. clone ( ) ,
3095- Usize => sym:: from_usize. clone ( ) ,
3081+ Format ( Display ) => sym:: new_display,
3082+ Format ( Debug ) => sym:: new_debug,
3083+ Format ( LowerExp ) => sym:: new_lower_exp,
3084+ Format ( UpperExp ) => sym:: new_upper_exp,
3085+ Format ( Octal ) => sym:: new_octal,
3086+ Format ( Pointer ) => sym:: new_pointer,
3087+ Format ( Binary ) => sym:: new_binary,
3088+ Format ( LowerHex ) => sym:: new_lower_hex,
3089+ Format ( UpperHex ) => sym:: new_upper_hex,
3090+ Usize => sym:: from_usize,
30963091 } ) ,
30973092 ) {
30983093 Some ( new_fn) => self . alloc_expr_desugared ( Expr :: Path ( new_fn) ) ,
0 commit comments