From aabd41cafc1a79f5ad124a31a360ab0442c13efd Mon Sep 17 00:00:00 2001 From: Maan2003 Date: Sun, 13 Jun 2021 09:40:22 +0530 Subject: clippy::redundant_field_names --- crates/hir_ty/src/infer/pat.rs | 2 +- crates/ide_assists/src/assist_context.rs | 2 +- crates/ide_completion/src/completions/postfix/format_like.rs | 2 +- crates/ide_ssr/src/tests.rs | 2 +- crates/mbe/src/expander/transcriber.rs | 2 +- crates/proc_macro_srv/src/proc_macro/diagnostic.rs | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/hir_ty/src/infer/pat.rs b/crates/hir_ty/src/infer/pat.rs index 8f5db1f40..035f4ded6 100644 --- a/crates/hir_ty/src/infer/pat.rs +++ b/crates/hir_ty/src/infer/pat.rs @@ -275,7 +275,7 @@ impl<'a> InferenceContext<'a> { if !self.unify(&ty, &expected) { self.result .type_mismatches - .insert(pat.into(), TypeMismatch { expected: expected, actual: ty.clone() }); + .insert(pat.into(), TypeMismatch { expected, actual: ty.clone() }); } self.write_pat_ty(pat, ty.clone()); ty diff --git a/crates/ide_assists/src/assist_context.rs b/crates/ide_assists/src/assist_context.rs index 8fc40f9bd..d207cacb2 100644 --- a/crates/ide_assists/src/assist_context.rs +++ b/crates/ide_assists/src/assist_context.rs @@ -292,7 +292,7 @@ impl AssistBuilder { } pub(crate) fn create_file(&mut self, dst: AnchoredPathBuf, content: impl Into) { let file_system_edit = - FileSystemEdit::CreateFile { dst: dst, initial_contents: content.into() }; + FileSystemEdit::CreateFile { dst, initial_contents: content.into() }; self.source_change.push_file_system_edit(file_system_edit); } diff --git a/crates/ide_completion/src/completions/postfix/format_like.rs b/crates/ide_completion/src/completions/postfix/format_like.rs index f619f8b52..2dc13c293 100644 --- a/crates/ide_completion/src/completions/postfix/format_like.rs +++ b/crates/ide_completion/src/completions/postfix/format_like.rs @@ -91,7 +91,7 @@ enum State { impl FormatStrParser { pub(crate) fn new(input: String) -> Self { Self { - input: input, + input, output: String::new(), extracted_expressions: Vec::new(), state: State::NotExpr, diff --git a/crates/ide_ssr/src/tests.rs b/crates/ide_ssr/src/tests.rs index 5dd0d600f..444c6b0af 100644 --- a/crates/ide_ssr/src/tests.rs +++ b/crates/ide_ssr/src/tests.rs @@ -75,7 +75,7 @@ pub(crate) fn single_file(code: &str) -> (ide_db::RootDatabase, FilePosition, Ve match range_or_offset { RangeOrOffset::Range(range) => { position = FilePosition { file_id, offset: range.start() }; - selections = vec![FileRange { file_id, range: range }]; + selections = vec![FileRange { file_id, range }]; } RangeOrOffset::Offset(offset) => { position = FilePosition { file_id, offset }; diff --git a/crates/mbe/src/expander/transcriber.rs b/crates/mbe/src/expander/transcriber.rs index 9a9c1a467..49a137577 100644 --- a/crates/mbe/src/expander/transcriber.rs +++ b/crates/mbe/src/expander/transcriber.rs @@ -55,7 +55,7 @@ pub(super) fn transcribe( template: &MetaTemplate, bindings: &Bindings, ) -> ExpandResult { - let mut ctx = ExpandCtx { bindings: bindings, nesting: Vec::new() }; + let mut ctx = ExpandCtx { bindings, nesting: Vec::new() }; let mut arena: Vec = Vec::new(); expand_subtree(&mut ctx, template, None, &mut arena) } diff --git a/crates/proc_macro_srv/src/proc_macro/diagnostic.rs b/crates/proc_macro_srv/src/proc_macro/diagnostic.rs index 55d93917c..a30818982 100644 --- a/crates/proc_macro_srv/src/proc_macro/diagnostic.rs +++ b/crates/proc_macro_srv/src/proc_macro/diagnostic.rs @@ -91,7 +91,7 @@ impl<'a> Iterator for Children<'a> { impl Diagnostic { /// Creates a new diagnostic with the given `level` and `message`. pub fn new>(level: Level, message: T) -> Diagnostic { - Diagnostic { level: level, message: message.into(), spans: vec![], children: vec![] } + Diagnostic { level, message: message.into(), spans: vec![], children: vec![] } } /// Creates a new diagnostic with the given `level` and `message` pointing to @@ -102,7 +102,7 @@ impl Diagnostic { T: Into, { Diagnostic { - level: level, + level, message: message.into(), spans: spans.into_spans(), children: vec![], -- cgit v1.2.3