@@ -32,7 +32,6 @@ use rustc_hash::{FxHashMap, FxHashSet};
32
32
use semver:: Version ;
33
33
use serde:: { de:: DeserializeOwned , Deserialize , Serialize } ;
34
34
use stdx:: format_to_acc;
35
- use toml;
36
35
use vfs:: { AbsPath , AbsPathBuf } ;
37
36
38
37
use crate :: {
@@ -135,7 +134,7 @@ config_data! {
135
134
/// Unsetting this disables sysroot loading.
136
135
///
137
136
/// This option does not take effect until rust-analyzer is restarted.
138
- cargo_sysroot: Option <String > = Some ( "discover" . to_string ( ) ) ,
137
+ cargo_sysroot: Option <String > = Some ( "discover" . to_owned ( ) ) ,
139
138
/// Whether to run cargo metadata on the sysroot library allowing rust-analyzer to analyze
140
139
/// third-party dependencies of the standard libraries.
141
140
///
@@ -168,7 +167,7 @@ config_data! {
168
167
/// Check all targets and tests (`--all-targets`).
169
168
check_allTargets | checkOnSave_allTargets: bool = true ,
170
169
/// Cargo command to use for `cargo check`.
171
- check_command | checkOnSave_command: String = "check" . to_string ( ) ,
170
+ check_command | checkOnSave_command: String = "check" . to_owned ( ) ,
172
171
/// Extra arguments for `cargo check`.
173
172
check_extraArgs | checkOnSave_extraArgs: Vec <String > = vec![ ] ,
174
173
/// Extra environment variables that will be set when running `cargo check`.
@@ -1468,16 +1467,16 @@ impl Config {
1468
1467
}
1469
1468
1470
1469
pub fn extra_args ( & self ) -> & Vec < String > {
1471
- & self . cargo_extraArgs ( )
1470
+ self . cargo_extraArgs ( )
1472
1471
}
1473
1472
1474
1473
pub fn extra_env ( & self ) -> & FxHashMap < String , String > {
1475
- & self . cargo_extraEnv ( )
1474
+ self . cargo_extraEnv ( )
1476
1475
}
1477
1476
1478
1477
pub fn check_extra_args ( & self ) -> Vec < String > {
1479
1478
let mut extra_args = self . extra_args ( ) . clone ( ) ;
1480
- extra_args. extend_from_slice ( & self . check_extraArgs ( ) ) ;
1479
+ extra_args. extend_from_slice ( self . check_extraArgs ( ) ) ;
1481
1480
extra_args
1482
1481
}
1483
1482
@@ -1497,11 +1496,11 @@ impl Config {
1497
1496
1498
1497
pub fn proc_macro_srv ( & self ) -> Option < AbsPathBuf > {
1499
1498
let path = self . procMacro_server ( ) . clone ( ) ?;
1500
- Some ( AbsPathBuf :: try_from ( path) . unwrap_or_else ( |path| self . root_path . join ( & path) ) )
1499
+ Some ( AbsPathBuf :: try_from ( path) . unwrap_or_else ( |path| self . root_path . join ( path) ) )
1501
1500
}
1502
1501
1503
1502
pub fn ignored_proc_macros ( & self ) -> & FxHashMap < Box < str > , Box < [ Box < str > ] > > {
1504
- & self . procMacro_ignored ( )
1503
+ self . procMacro_ignored ( )
1505
1504
}
1506
1505
1507
1506
pub fn expand_proc_macros ( & self ) -> bool {
@@ -1667,7 +1666,7 @@ impl Config {
1667
1666
. check_noDefaultFeatures ( )
1668
1667
. unwrap_or ( * self . cargo_noDefaultFeatures ( ) ) ,
1669
1668
all_features : matches ! (
1670
- self . check_features( ) . as_ref( ) . unwrap_or( & self . cargo_features( ) ) ,
1669
+ self . check_features( ) . as_ref( ) . unwrap_or( self . cargo_features( ) ) ,
1671
1670
CargoFeaturesDef :: All
1672
1671
) ,
1673
1672
features : match self
@@ -2022,13 +2021,13 @@ mod single_or_array {
2022
2021
deserializer. deserialize_any ( SingleOrVec )
2023
2022
}
2024
2023
2025
- pub ( super ) fn serialize < S > ( vec : & Vec < String > , serializer : S ) -> Result < S :: Ok , S :: Error >
2024
+ pub ( super ) fn serialize < S > ( vec : & [ String ] , serializer : S ) -> Result < S :: Ok , S :: Error >
2026
2025
where
2027
2026
S : serde:: Serializer ,
2028
2027
{
2029
- match & vec[ .. ] {
2028
+ match vec {
2030
2029
// [] case is handled by skip_serializing_if
2031
- [ single] => serializer. serialize_str ( & single) ,
2030
+ [ single] => serializer. serialize_str ( single) ,
2032
2031
slice => slice. serialize ( serializer) ,
2033
2032
}
2034
2033
}
@@ -2247,7 +2246,7 @@ macro_rules! _default_val {
2247
2246
2248
2247
macro_rules! _default_str {
2249
2248
( @verbatim: $s: literal, $_ty: ty) => {
2250
- $s. to_string ( )
2249
+ $s. to_owned ( )
2251
2250
} ;
2252
2251
( $default: expr, $ty: ty) => { {
2253
2252
let val = default_val!( $default, $ty) ;
0 commit comments