@@ -137,7 +137,7 @@ config_data! {
137
137
/// Unsetting this disables sysroot loading.
138
138
///
139
139
/// 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 ( ) ) ,
141
141
/// Whether to run cargo metadata on the sysroot library allowing rust-analyzer to analyze
142
142
/// third-party dependencies of the standard libraries.
143
143
///
@@ -170,7 +170,7 @@ config_data! {
170
170
/// Check all targets and tests (`--all-targets`).
171
171
check_allTargets | checkOnSave_allTargets: bool = true ,
172
172
/// 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 ( ) ,
174
174
/// Extra arguments for `cargo check`.
175
175
check_extraArgs | checkOnSave_extraArgs: Vec <String > = vec![ ] ,
176
176
/// Extra environment variables that will be set when running `cargo check`.
@@ -1466,16 +1466,16 @@ impl Config {
1466
1466
}
1467
1467
1468
1468
pub fn extra_args ( & self ) -> & Vec < String > {
1469
- & self . cargo_extraArgs ( )
1469
+ self . cargo_extraArgs ( )
1470
1470
}
1471
1471
1472
1472
pub fn extra_env ( & self ) -> & FxHashMap < String , String > {
1473
- & self . cargo_extraEnv ( )
1473
+ self . cargo_extraEnv ( )
1474
1474
}
1475
1475
1476
1476
pub fn check_extra_args ( & self ) -> Vec < String > {
1477
1477
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 ( ) ) ;
1479
1479
extra_args
1480
1480
}
1481
1481
@@ -1495,11 +1495,11 @@ impl Config {
1495
1495
1496
1496
pub fn proc_macro_srv ( & self ) -> Option < AbsPathBuf > {
1497
1497
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) ) )
1499
1499
}
1500
1500
1501
1501
pub fn ignored_proc_macros ( & self ) -> & FxHashMap < Box < str > , Box < [ Box < str > ] > > {
1502
- & self . procMacro_ignored ( )
1502
+ self . procMacro_ignored ( )
1503
1503
}
1504
1504
1505
1505
pub fn expand_proc_macros ( & self ) -> bool {
@@ -1665,7 +1665,7 @@ impl Config {
1665
1665
. check_noDefaultFeatures ( )
1666
1666
. unwrap_or ( * self . cargo_noDefaultFeatures ( ) ) ,
1667
1667
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( ) ) ,
1669
1669
CargoFeaturesDef :: All
1670
1670
) ,
1671
1671
features : match self
@@ -2018,13 +2018,13 @@ mod single_or_array {
2018
2018
deserializer. deserialize_any ( SingleOrVec )
2019
2019
}
2020
2020
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 >
2022
2022
where
2023
2023
S : serde:: Serializer ,
2024
2024
{
2025
- match & vec[ .. ] {
2025
+ match vec {
2026
2026
// [] case is handled by skip_serializing_if
2027
- [ single] => serializer. serialize_str ( & single) ,
2027
+ [ single] => serializer. serialize_str ( single) ,
2028
2028
slice => slice. serialize ( serializer) ,
2029
2029
}
2030
2030
}
@@ -2243,7 +2243,7 @@ macro_rules! _default_val {
2243
2243
2244
2244
macro_rules! _default_str {
2245
2245
( @verbatim: $s: literal, $_ty: ty) => {
2246
- $s. to_string ( )
2246
+ $s. to_owned ( )
2247
2247
} ;
2248
2248
( $default: expr, $ty: ty) => { {
2249
2249
let val = default_val!( $default, $ty) ;
0 commit comments