@@ -137,7 +137,7 @@ config_data! {
137137 /// Unsetting this disables sysroot loading.
138138 ///
139139 /// This option does not take effect until rust-analyzer is restarted.
140- cargo_sysroot: Option <String > = Some ( "discover" . to_string ( ) ) ,
140+ cargo_sysroot: Option <String > = Some ( "discover" . to_owned ( ) ) ,
141141 /// Whether to run cargo metadata on the sysroot library allowing rust-analyzer to analyze
142142 /// third-party dependencies of the standard libraries.
143143 ///
@@ -170,7 +170,7 @@ config_data! {
170170 /// Check all targets and tests (`--all-targets`).
171171 check_allTargets | checkOnSave_allTargets: bool = true ,
172172 /// Cargo command to use for `cargo check`.
173- check_command | checkOnSave_command: String = "check" . to_string ( ) ,
173+ check_command | checkOnSave_command: String = "check" . to_owned ( ) ,
174174 /// Extra arguments for `cargo check`.
175175 check_extraArgs | checkOnSave_extraArgs: Vec <String > = vec![ ] ,
176176 /// Extra environment variables that will be set when running `cargo check`.
@@ -1466,16 +1466,16 @@ impl Config {
14661466 }
14671467
14681468 pub fn extra_args ( & self ) -> & Vec < String > {
1469- & self . cargo_extraArgs ( )
1469+ self . cargo_extraArgs ( )
14701470 }
14711471
14721472 pub fn extra_env ( & self ) -> & FxHashMap < String , String > {
1473- & self . cargo_extraEnv ( )
1473+ self . cargo_extraEnv ( )
14741474 }
14751475
14761476 pub fn check_extra_args ( & self ) -> Vec < String > {
14771477 let mut extra_args = self . extra_args ( ) . clone ( ) ;
1478- extra_args. extend_from_slice ( & self . check_extraArgs ( ) ) ;
1478+ extra_args. extend_from_slice ( self . check_extraArgs ( ) ) ;
14791479 extra_args
14801480 }
14811481
@@ -1495,11 +1495,11 @@ impl Config {
14951495
14961496 pub fn proc_macro_srv ( & self ) -> Option < AbsPathBuf > {
14971497 let path = self . procMacro_server ( ) . clone ( ) ?;
1498- Some ( AbsPathBuf :: try_from ( path) . unwrap_or_else ( |path| self . root_path . join ( & path) ) )
1498+ Some ( AbsPathBuf :: try_from ( path) . unwrap_or_else ( |path| self . root_path . join ( path) ) )
14991499 }
15001500
15011501 pub fn ignored_proc_macros ( & self ) -> & FxHashMap < Box < str > , Box < [ Box < str > ] > > {
1502- & self . procMacro_ignored ( )
1502+ self . procMacro_ignored ( )
15031503 }
15041504
15051505 pub fn expand_proc_macros ( & self ) -> bool {
@@ -1665,7 +1665,7 @@ impl Config {
16651665 . check_noDefaultFeatures ( )
16661666 . unwrap_or ( * self . cargo_noDefaultFeatures ( ) ) ,
16671667 all_features : matches ! (
1668- self . check_features( ) . as_ref( ) . unwrap_or( & self . cargo_features( ) ) ,
1668+ self . check_features( ) . as_ref( ) . unwrap_or( self . cargo_features( ) ) ,
16691669 CargoFeaturesDef :: All
16701670 ) ,
16711671 features : match self
@@ -2018,13 +2018,13 @@ mod single_or_array {
20182018 deserializer. deserialize_any ( SingleOrVec )
20192019 }
20202020
2021- pub ( crate ) fn serialize < S > ( vec : & Vec < String > , serializer : S ) -> Result < S :: Ok , S :: Error >
2021+ pub ( crate ) fn serialize < S > ( vec : & [ String ] , serializer : S ) -> Result < S :: Ok , S :: Error >
20222022 where
20232023 S : serde:: Serializer ,
20242024 {
2025- match & vec[ .. ] {
2025+ match vec {
20262026 // [] case is handled by skip_serializing_if
2027- [ single] => serializer. serialize_str ( & single) ,
2027+ [ single] => serializer. serialize_str ( single) ,
20282028 slice => slice. serialize ( serializer) ,
20292029 }
20302030 }
@@ -2243,7 +2243,7 @@ macro_rules! _default_val {
22432243
22442244macro_rules! _default_str {
22452245 ( @verbatim: $s: literal, $_ty: ty) => {
2246- $s. to_string ( )
2246+ $s. to_owned ( )
22472247 } ;
22482248 ( $default: expr, $ty: ty) => { {
22492249 let val = default_val!( $default, $ty) ;
0 commit comments