Skip to content

Commit 6d5d76d

Browse files
committed
fix some clippy errors.
1 parent a646e55 commit 6d5d76d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

crates/rust-analyzer/src/config.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ config_data! {
137137
/// Unsetting this disables sysroot loading.
138138
///
139139
/// 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()),
141141
/// Whether to run cargo metadata on the sysroot library allowing rust-analyzer to analyze
142142
/// third-party dependencies of the standard libraries.
143143
///
@@ -170,7 +170,7 @@ config_data! {
170170
/// Check all targets and tests (`--all-targets`).
171171
check_allTargets | checkOnSave_allTargets: bool = true,
172172
/// 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(),
174174
/// Extra arguments for `cargo check`.
175175
check_extraArgs | checkOnSave_extraArgs: Vec<String> = vec![],
176176
/// Extra environment variables that will be set when running `cargo check`.
@@ -1460,16 +1460,16 @@ impl Config {
14601460
}
14611461

14621462
pub fn extra_args(&self) -> &Vec<String> {
1463-
&self.cargo_extraArgs()
1463+
self.cargo_extraArgs()
14641464
}
14651465

14661466
pub fn extra_env(&self) -> &FxHashMap<String, String> {
1467-
&self.cargo_extraEnv()
1467+
self.cargo_extraEnv()
14681468
}
14691469

14701470
pub fn check_extra_args(&self) -> Vec<String> {
14711471
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());
14731473
extra_args
14741474
}
14751475

@@ -1489,11 +1489,11 @@ impl Config {
14891489

14901490
pub fn proc_macro_srv(&self) -> Option<AbsPathBuf> {
14911491
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)))
14931493
}
14941494

14951495
pub fn ignored_proc_macros(&self) -> &FxHashMap<Box<str>, Box<[Box<str>]>> {
1496-
&self.procMacro_ignored()
1496+
self.procMacro_ignored()
14971497
}
14981498

14991499
pub fn expand_proc_macros(&self) -> bool {
@@ -1659,7 +1659,7 @@ impl Config {
16591659
.check_noDefaultFeatures()
16601660
.unwrap_or(*self.cargo_noDefaultFeatures()),
16611661
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()),
16631663
CargoFeaturesDef::All
16641664
),
16651665
features: match self
@@ -2012,13 +2012,13 @@ mod single_or_array {
20122012
deserializer.deserialize_any(SingleOrVec)
20132013
}
20142014

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>
20162016
where
20172017
S: serde::Serializer,
20182018
{
2019-
match &vec[..] {
2019+
match vec {
20202020
// [] case is handled by skip_serializing_if
2021-
[single] => serializer.serialize_str(&single),
2021+
[single] => serializer.serialize_str(single),
20222022
slice => slice.serialize(serializer),
20232023
}
20242024
}
@@ -2237,7 +2237,7 @@ macro_rules! _default_val {
22372237

22382238
macro_rules! _default_str {
22392239
(@verbatim: $s:literal, $_ty:ty) => {
2240-
$s.to_string()
2240+
$s.to_owned()
22412241
};
22422242
($default:expr, $ty:ty) => {{
22432243
let val = default_val!($default, $ty);

0 commit comments

Comments
 (0)