@@ -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 :: {
@@ -137,7 +136,7 @@ config_data! {
137
136
/// Unsetting this disables sysroot loading.
138
137
///
139
138
/// This option does not take effect until rust-analyzer is restarted.
140
- cargo_sysroot: Option <String > = Some ( "discover" . to_string ( ) ) ,
139
+ cargo_sysroot: Option <String > = Some ( "discover" . to_owned ( ) ) ,
141
140
/// Whether to run cargo metadata on the sysroot library allowing rust-analyzer to analyze
142
141
/// third-party dependencies of the standard libraries.
143
142
///
@@ -171,7 +170,7 @@ config_data! {
171
170
/// `#rust-analyzer.cargo.allTargets#`.
172
171
check_allTargets | checkOnSave_allTargets: Option <bool > = Option :: <bool >:: None ,
173
172
/// Cargo command to use for `cargo check`.
174
- check_command | checkOnSave_command: String = "check" . to_string ( ) ,
173
+ check_command | checkOnSave_command: String = "check" . to_owned ( ) ,
175
174
/// Extra arguments for `cargo check`.
176
175
check_extraArgs | checkOnSave_extraArgs: Vec <String > = vec![ ] ,
177
176
/// Extra environment variables that will be set when running `cargo check`.
@@ -1485,16 +1484,16 @@ impl Config {
1485
1484
}
1486
1485
1487
1486
pub fn extra_args ( & self ) -> & Vec < String > {
1488
- & self . cargo_extraArgs ( )
1487
+ self . cargo_extraArgs ( )
1489
1488
}
1490
1489
1491
1490
pub fn extra_env ( & self ) -> & FxHashMap < String , String > {
1492
- & self . cargo_extraEnv ( )
1491
+ self . cargo_extraEnv ( )
1493
1492
}
1494
1493
1495
1494
pub fn check_extra_args ( & self ) -> Vec < String > {
1496
1495
let mut extra_args = self . extra_args ( ) . clone ( ) ;
1497
- extra_args. extend_from_slice ( & self . check_extraArgs ( ) ) ;
1496
+ extra_args. extend_from_slice ( self . check_extraArgs ( ) ) ;
1498
1497
extra_args
1499
1498
}
1500
1499
@@ -1514,11 +1513,11 @@ impl Config {
1514
1513
1515
1514
pub fn proc_macro_srv ( & self ) -> Option < AbsPathBuf > {
1516
1515
let path = self . procMacro_server ( ) . clone ( ) ?;
1517
- Some ( AbsPathBuf :: try_from ( path) . unwrap_or_else ( |path| self . root_path . join ( & path) ) )
1516
+ Some ( AbsPathBuf :: try_from ( path) . unwrap_or_else ( |path| self . root_path . join ( path) ) )
1518
1517
}
1519
1518
1520
1519
pub fn ignored_proc_macros ( & self ) -> & FxHashMap < Box < str > , Box < [ Box < str > ] > > {
1521
- & self . procMacro_ignored ( )
1520
+ self . procMacro_ignored ( )
1522
1521
}
1523
1522
1524
1523
pub fn expand_proc_macros ( & self ) -> bool {
@@ -2061,13 +2060,13 @@ mod single_or_array {
2061
2060
deserializer. deserialize_any ( SingleOrVec )
2062
2061
}
2063
2062
2064
- pub ( super ) fn serialize < S > ( vec : & Vec < String > , serializer : S ) -> Result < S :: Ok , S :: Error >
2063
+ pub ( super ) fn serialize < S > ( vec : & [ String ] , serializer : S ) -> Result < S :: Ok , S :: Error >
2065
2064
where
2066
2065
S : serde:: Serializer ,
2067
2066
{
2068
- match & vec[ .. ] {
2067
+ match vec {
2069
2068
// [] case is handled by skip_serializing_if
2070
- [ single] => serializer. serialize_str ( & single) ,
2069
+ [ single] => serializer. serialize_str ( single) ,
2071
2070
slice => slice. serialize ( serializer) ,
2072
2071
}
2073
2072
}
@@ -2286,7 +2285,7 @@ macro_rules! _default_val {
2286
2285
2287
2286
macro_rules! _default_str {
2288
2287
( @verbatim: $s: literal, $_ty: ty) => {
2289
- $s. to_string ( )
2288
+ $s. to_owned ( )
2290
2289
} ;
2291
2290
( $default: expr, $ty: ty) => { {
2292
2291
let val = default_val!( $default, $ty) ;
0 commit comments