@@ -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
///
@@ -163,7 +163,7 @@ config_data! {
163
163
/// Check all targets and tests (`--all-targets`).
164
164
check_allTargets | checkOnSave_allTargets: bool = true ,
165
165
/// 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 ( ) ,
167
167
/// Extra arguments for `cargo check`.
168
168
check_extraArgs | checkOnSave_extraArgs: Vec <String > = vec![ ] ,
169
169
/// Extra environment variables that will be set when running `cargo check`.
@@ -1461,16 +1461,16 @@ impl Config {
1461
1461
}
1462
1462
1463
1463
pub fn extra_args ( & self ) -> & Vec < String > {
1464
- & self . cargo_extraArgs ( )
1464
+ self . cargo_extraArgs ( )
1465
1465
}
1466
1466
1467
1467
pub fn extra_env ( & self ) -> & FxHashMap < String , String > {
1468
- & self . cargo_extraEnv ( )
1468
+ self . cargo_extraEnv ( )
1469
1469
}
1470
1470
1471
1471
pub fn check_extra_args ( & self ) -> Vec < String > {
1472
1472
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 ( ) ) ;
1474
1474
extra_args
1475
1475
}
1476
1476
@@ -1490,11 +1490,11 @@ impl Config {
1490
1490
1491
1491
pub fn proc_macro_srv ( & self ) -> Option < AbsPathBuf > {
1492
1492
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) ) )
1494
1494
}
1495
1495
1496
1496
pub fn ignored_proc_macros ( & self ) -> & FxHashMap < Box < str > , Box < [ Box < str > ] > > {
1497
- & self . procMacro_ignored ( )
1497
+ self . procMacro_ignored ( )
1498
1498
}
1499
1499
1500
1500
pub fn expand_proc_macros ( & self ) -> bool {
@@ -1660,7 +1660,7 @@ impl Config {
1660
1660
. check_noDefaultFeatures ( )
1661
1661
. unwrap_or ( * self . cargo_noDefaultFeatures ( ) ) ,
1662
1662
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( ) ) ,
1664
1664
CargoFeaturesDef :: All
1665
1665
) ,
1666
1666
features : match self
@@ -2015,13 +2015,13 @@ mod single_or_array {
2015
2015
deserializer. deserialize_any ( SingleOrVec )
2016
2016
}
2017
2017
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 >
2019
2019
where
2020
2020
S : serde:: Serializer ,
2021
2021
{
2022
- match & vec[ .. ] {
2022
+ match vec {
2023
2023
// [] case is handled by skip_serializing_if
2024
- [ single] => serializer. serialize_str ( & single) ,
2024
+ [ single] => serializer. serialize_str ( single) ,
2025
2025
slice => slice. serialize ( serializer) ,
2026
2026
}
2027
2027
}
@@ -2240,7 +2240,7 @@ macro_rules! _default_val {
2240
2240
2241
2241
macro_rules! _default_str {
2242
2242
( @verbatim: $s: literal, $_ty: ty) => {
2243
- $s. to_string ( )
2243
+ $s. to_owned ( )
2244
2244
} ;
2245
2245
( $default: expr, $ty: ty) => { {
2246
2246
let val = default_val!( $default, $ty) ;
0 commit comments