@@ -105,7 +105,7 @@ pub(super) fn lower_body(
105
105
let is_mutable =
106
106
self_param_syn. mut_token ( ) . is_some ( ) && self_param_syn. amp_token ( ) . is_none ( ) ;
107
107
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_) ,
109
109
BindingAnnotation :: new ( is_mutable, false ) ,
110
110
) ;
111
111
self_param = Some ( binding_id) ;
@@ -137,7 +137,7 @@ pub(super) fn lower_body(
137
137
let is_mutable =
138
138
self_param_syn. mut_token ( ) . is_some ( ) && self_param_syn. amp_token ( ) . is_none ( ) ;
139
139
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_) ,
141
141
BindingAnnotation :: new ( is_mutable, false ) ,
142
142
) ;
143
143
let hygiene = self_param_syn
@@ -322,7 +322,7 @@ pub(crate) fn lower_function(
322
322
Some ( ty) => collector. lower_type_ref ( ty, & mut impl_trait_lower_fn) ,
323
323
None => {
324
324
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 ( ) ,
326
326
) ) ;
327
327
let lifetime = param
328
328
. lifetime ( )
@@ -375,7 +375,7 @@ pub(crate) fn lower_function(
375
375
let mut generic_args: Vec < _ > =
376
376
std:: iter:: repeat_n ( None , path. segments ( ) . len ( ) - 1 ) . collect ( ) ;
377
377
let binding = AssociatedTypeBinding {
378
- name : Name :: new_symbol_root ( sym:: Output . clone ( ) ) ,
378
+ name : Name :: new_symbol_root ( sym:: Output ) ,
379
379
args : None ,
380
380
type_ref : Some (
381
381
return_type
@@ -631,7 +631,7 @@ impl ExprCollector<'_> {
631
631
match abi. abi_string ( ) {
632
632
Some ( tok) => Symbol :: intern ( tok. text_without_quotes ( ) ) ,
633
633
// `extern` default to be `extern "C"`.
634
- _ => sym:: C . clone ( ) ,
634
+ _ => sym:: C ,
635
635
}
636
636
}
637
637
@@ -760,7 +760,7 @@ impl ExprCollector<'_> {
760
760
let bindings = if let Some ( ret_type) = ret_type {
761
761
let type_ref = self . lower_type_ref_opt ( ret_type. ty ( ) , impl_trait_lower_fn) ;
762
762
Box :: new ( [ AssociatedTypeBinding {
763
- name : Name :: new_symbol_root ( sym:: Output . clone ( ) ) ,
763
+ name : Name :: new_symbol_root ( sym:: Output ) ,
764
764
args : None ,
765
765
type_ref : Some ( type_ref) ,
766
766
bounds : Box :: default ( ) ,
@@ -769,7 +769,7 @@ impl ExprCollector<'_> {
769
769
// -> ()
770
770
let type_ref = self . alloc_type_ref_desugared ( TypeRef :: unit ( ) ) ;
771
771
Box :: new ( [ AssociatedTypeBinding {
772
- name : Name :: new_symbol_root ( sym:: Output . clone ( ) ) ,
772
+ name : Name :: new_symbol_root ( sym:: Output ) ,
773
773
args : None ,
774
774
type_ref : Some ( type_ref) ,
775
775
bounds : Box :: default ( ) ,
@@ -2804,12 +2804,12 @@ impl ExprCollector<'_> {
2804
2804
let new_v1_formatted = LangItem :: FormatArguments . ty_rel_path (
2805
2805
self . db ,
2806
2806
self . module . krate ( ) ,
2807
- Name :: new_symbol_root ( sym:: new_v1_formatted. clone ( ) ) ,
2807
+ Name :: new_symbol_root ( sym:: new_v1_formatted) ,
2808
2808
) ;
2809
2809
let unsafe_arg_new = LangItem :: FormatUnsafeArg . ty_rel_path (
2810
2810
self . db ,
2811
2811
self . module . krate ( ) ,
2812
- Name :: new_symbol_root ( sym:: new. clone ( ) ) ,
2812
+ Name :: new_symbol_root ( sym:: new) ,
2813
2813
) ;
2814
2814
let new_v1_formatted =
2815
2815
self . alloc_expr_desugared ( new_v1_formatted. map_or ( Expr :: Missing , Expr :: Path ) ) ;
@@ -2924,20 +2924,15 @@ impl ExprCollector<'_> {
2924
2924
Some ( BuiltinUint :: U32 ) ,
2925
2925
) ) ) ;
2926
2926
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 } ;
2933
2930
let precision = RecordLitField {
2934
- name : Name :: new_symbol_root ( sym:: precision. clone ( ) ) ,
2931
+ name : Name :: new_symbol_root ( sym:: precision) ,
2935
2932
expr : precision_expr,
2936
2933
} ;
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 } ;
2941
2936
self . alloc_expr_desugared ( Expr :: RecordLit {
2942
2937
path : LangItem :: FormatPlaceholder . path ( self . db , self . module . krate ( ) ) . map ( Box :: new) ,
2943
2938
fields : Box :: new ( [ position, flags, precision, width] ) ,
@@ -2948,7 +2943,7 @@ impl ExprCollector<'_> {
2948
2943
let format_placeholder_new = LangItem :: FormatPlaceholder . ty_rel_path (
2949
2944
self . db ,
2950
2945
self . module . krate ( ) ,
2951
- Name :: new_symbol_root ( sym:: new. clone ( ) ) ,
2946
+ Name :: new_symbol_root ( sym:: new) ,
2952
2947
) ;
2953
2948
match format_placeholder_new {
2954
2949
Some ( path) => self . alloc_expr_desugared ( Expr :: Path ( path) ) ,
@@ -2972,10 +2967,10 @@ impl ExprCollector<'_> {
2972
2967
self . db ,
2973
2968
self . module . krate ( ) ,
2974
2969
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 ) ,
2979
2974
} ,
2980
2975
) ;
2981
2976
match align {
@@ -3024,7 +3019,7 @@ impl ExprCollector<'_> {
3024
3019
let count_is = match LangItem :: FormatCount . ty_rel_path (
3025
3020
self . db ,
3026
3021
self . module . krate ( ) ,
3027
- Name :: new_symbol_root ( sym:: Is . clone ( ) ) ,
3022
+ Name :: new_symbol_root ( sym:: Is ) ,
3028
3023
) {
3029
3024
Some ( count_is) => self . alloc_expr_desugared ( Expr :: Path ( count_is) ) ,
3030
3025
None => self . missing_expr ( ) ,
@@ -3042,7 +3037,7 @@ impl ExprCollector<'_> {
3042
3037
let count_param = match LangItem :: FormatCount . ty_rel_path (
3043
3038
self . db ,
3044
3039
self . module . krate ( ) ,
3045
- Name :: new_symbol_root ( sym:: Param . clone ( ) ) ,
3040
+ Name :: new_symbol_root ( sym:: Param ) ,
3046
3041
) {
3047
3042
Some ( count_param) => self . alloc_expr_desugared ( Expr :: Path ( count_param) ) ,
3048
3043
None => self . missing_expr ( ) ,
@@ -3060,7 +3055,7 @@ impl ExprCollector<'_> {
3060
3055
None => match LangItem :: FormatCount . ty_rel_path (
3061
3056
self . db ,
3062
3057
self . module . krate ( ) ,
3063
- Name :: new_symbol_root ( sym:: Implied . clone ( ) ) ,
3058
+ Name :: new_symbol_root ( sym:: Implied ) ,
3064
3059
) {
3065
3060
Some ( count_param) => self . alloc_expr_desugared ( Expr :: Path ( count_param) ) ,
3066
3061
None => self . missing_expr ( ) ,
@@ -3083,16 +3078,16 @@ impl ExprCollector<'_> {
3083
3078
self . db ,
3084
3079
self . module . krate ( ) ,
3085
3080
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,
3096
3091
} ) ,
3097
3092
) {
3098
3093
Some ( new_fn) => self . alloc_expr_desugared ( Expr :: Path ( new_fn) ) ,
0 commit comments