@@ -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 ///
@@ -163,7 +163,7 @@ config_data! {
163163 /// Check all targets and tests (`--all-targets`).
164164 check_allTargets | checkOnSave_allTargets: bool = true ,
165165 /// Cargo command to use for `cargo check`.
166- check_command | checkOnSave_command: String = "check" . to_string ( ) ,
166+ check_command | checkOnSave_command: String = "check" . to_owned ( ) ,
167167 /// Extra arguments for `cargo check`.
168168 check_extraArgs | checkOnSave_extraArgs: Vec <String > = vec![ ] ,
169169 /// Extra environment variables that will be set when running `cargo check`.
@@ -1461,16 +1461,16 @@ impl Config {
14611461 }
14621462
14631463 pub fn extra_args ( & self ) -> & Vec < String > {
1464- & self . cargo_extraArgs ( )
1464+ self . cargo_extraArgs ( )
14651465 }
14661466
14671467 pub fn extra_env ( & self ) -> & FxHashMap < String , String > {
1468- & self . cargo_extraEnv ( )
1468+ self . cargo_extraEnv ( )
14691469 }
14701470
14711471 pub fn check_extra_args ( & self ) -> Vec < String > {
14721472 let mut extra_args = self . extra_args ( ) . clone ( ) ;
1473- extra_args. extend_from_slice ( & self . check_extraArgs ( ) ) ;
1473+ extra_args. extend_from_slice ( self . check_extraArgs ( ) ) ;
14741474 extra_args
14751475 }
14761476
@@ -1490,11 +1490,11 @@ impl Config {
14901490
14911491 pub fn proc_macro_srv ( & self ) -> Option < AbsPathBuf > {
14921492 let path = self . procMacro_server ( ) . clone ( ) ?;
1493- Some ( AbsPathBuf :: try_from ( path) . unwrap_or_else ( |path| self . root_path . join ( & path) ) )
1493+ Some ( AbsPathBuf :: try_from ( path) . unwrap_or_else ( |path| self . root_path . join ( path) ) )
14941494 }
14951495
14961496 pub fn ignored_proc_macros ( & self ) -> & FxHashMap < Box < str > , Box < [ Box < str > ] > > {
1497- & self . procMacro_ignored ( )
1497+ self . procMacro_ignored ( )
14981498 }
14991499
15001500 pub fn expand_proc_macros ( & self ) -> bool {
@@ -1660,7 +1660,7 @@ impl Config {
16601660 . check_noDefaultFeatures ( )
16611661 . unwrap_or ( * self . cargo_noDefaultFeatures ( ) ) ,
16621662 all_features : matches ! (
1663- self . check_features( ) . as_ref( ) . unwrap_or( & self . cargo_features( ) ) ,
1663+ self . check_features( ) . as_ref( ) . unwrap_or( self . cargo_features( ) ) ,
16641664 CargoFeaturesDef :: All
16651665 ) ,
16661666 features : match self
@@ -2015,13 +2015,13 @@ mod single_or_array {
20152015 deserializer. deserialize_any ( SingleOrVec )
20162016 }
20172017
2018- pub ( crate ) fn serialize < S > ( vec : & Vec < String > , serializer : S ) -> Result < S :: Ok , S :: Error >
2018+ pub ( crate ) fn serialize < S > ( vec : & [ String ] , serializer : S ) -> Result < S :: Ok , S :: Error >
20192019 where
20202020 S : serde:: Serializer ,
20212021 {
2022- match & vec[ .. ] {
2022+ match vec {
20232023 // [] case is handled by skip_serializing_if
2024- [ single] => serializer. serialize_str ( & single) ,
2024+ [ single] => serializer. serialize_str ( single) ,
20252025 slice => slice. serialize ( serializer) ,
20262026 }
20272027 }
@@ -2240,7 +2240,7 @@ macro_rules! _default_val {
22402240
22412241macro_rules! _default_str {
22422242 ( @verbatim: $s: literal, $_ty: ty) => {
2243- $s. to_string ( )
2243+ $s. to_owned ( )
22442244 } ;
22452245 ( $default: expr, $ty: ty) => { {
22462246 let val = default_val!( $default, $ty) ;
0 commit comments