@@ -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`.
@@ -1460,16 +1460,16 @@ impl Config {
1460
1460
}
1461
1461
1462
1462
pub fn extra_args ( & self ) -> & Vec < String > {
1463
- & self . cargo_extraArgs ( )
1463
+ self . cargo_extraArgs ( )
1464
1464
}
1465
1465
1466
1466
pub fn extra_env ( & self ) -> & FxHashMap < String , String > {
1467
- & self . cargo_extraEnv ( )
1467
+ self . cargo_extraEnv ( )
1468
1468
}
1469
1469
1470
1470
pub fn check_extra_args ( & self ) -> Vec < String > {
1471
1471
let mut extra_args = self . extra_args ( ) . clone ( ) ;
1472
- extra_args. extend_from_slice ( & self . check_extraArgs ( ) ) ;
1472
+ extra_args. extend_from_slice ( self . check_extraArgs ( ) ) ;
1473
1473
extra_args
1474
1474
}
1475
1475
@@ -1489,11 +1489,11 @@ impl Config {
1489
1489
1490
1490
pub fn proc_macro_srv ( & self ) -> Option < AbsPathBuf > {
1491
1491
let path = self . procMacro_server ( ) . clone ( ) ?;
1492
- Some ( AbsPathBuf :: try_from ( path) . unwrap_or_else ( |path| self . root_path . join ( & path) ) )
1492
+ Some ( AbsPathBuf :: try_from ( path) . unwrap_or_else ( |path| self . root_path . join ( path) ) )
1493
1493
}
1494
1494
1495
1495
pub fn ignored_proc_macros ( & self ) -> & FxHashMap < Box < str > , Box < [ Box < str > ] > > {
1496
- & self . procMacro_ignored ( )
1496
+ self . procMacro_ignored ( )
1497
1497
}
1498
1498
1499
1499
pub fn expand_proc_macros ( & self ) -> bool {
@@ -1659,7 +1659,7 @@ impl Config {
1659
1659
. check_noDefaultFeatures ( )
1660
1660
. unwrap_or ( * self . cargo_noDefaultFeatures ( ) ) ,
1661
1661
all_features : matches ! (
1662
- self . check_features( ) . as_ref( ) . unwrap_or( & self . cargo_features( ) ) ,
1662
+ self . check_features( ) . as_ref( ) . unwrap_or( self . cargo_features( ) ) ,
1663
1663
CargoFeaturesDef :: All
1664
1664
) ,
1665
1665
features : match self
@@ -2012,13 +2012,13 @@ mod single_or_array {
2012
2012
deserializer. deserialize_any ( SingleOrVec )
2013
2013
}
2014
2014
2015
- pub ( crate ) fn serialize < S > ( vec : & Vec < String > , serializer : S ) -> Result < S :: Ok , S :: Error >
2015
+ pub ( crate ) fn serialize < S > ( vec : & [ String ] , serializer : S ) -> Result < S :: Ok , S :: Error >
2016
2016
where
2017
2017
S : serde:: Serializer ,
2018
2018
{
2019
- match & vec[ .. ] {
2019
+ match vec {
2020
2020
// [] case is handled by skip_serializing_if
2021
- [ single] => serializer. serialize_str ( & single) ,
2021
+ [ single] => serializer. serialize_str ( single) ,
2022
2022
slice => slice. serialize ( serializer) ,
2023
2023
}
2024
2024
}
@@ -2237,7 +2237,7 @@ macro_rules! _default_val {
2237
2237
2238
2238
macro_rules! _default_str {
2239
2239
( @verbatim: $s: literal, $_ty: ty) => {
2240
- $s. to_string ( )
2240
+ $s. to_owned ( )
2241
2241
} ;
2242
2242
( $default: expr, $ty: ty) => { {
2243
2243
let val = default_val!( $default, $ty) ;
0 commit comments