mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
clippy::redundant_field_names
This commit is contained in:
parent
b857a5dcf0
commit
aabd41cafc
6 changed files with 7 additions and 7 deletions
|
@ -275,7 +275,7 @@ impl<'a> InferenceContext<'a> {
|
||||||
if !self.unify(&ty, &expected) {
|
if !self.unify(&ty, &expected) {
|
||||||
self.result
|
self.result
|
||||||
.type_mismatches
|
.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());
|
self.write_pat_ty(pat, ty.clone());
|
||||||
ty
|
ty
|
||||||
|
|
|
@ -292,7 +292,7 @@ impl AssistBuilder {
|
||||||
}
|
}
|
||||||
pub(crate) fn create_file(&mut self, dst: AnchoredPathBuf, content: impl Into<String>) {
|
pub(crate) fn create_file(&mut self, dst: AnchoredPathBuf, content: impl Into<String>) {
|
||||||
let file_system_edit =
|
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);
|
self.source_change.push_file_system_edit(file_system_edit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ enum State {
|
||||||
impl FormatStrParser {
|
impl FormatStrParser {
|
||||||
pub(crate) fn new(input: String) -> Self {
|
pub(crate) fn new(input: String) -> Self {
|
||||||
Self {
|
Self {
|
||||||
input: input,
|
input,
|
||||||
output: String::new(),
|
output: String::new(),
|
||||||
extracted_expressions: Vec::new(),
|
extracted_expressions: Vec::new(),
|
||||||
state: State::NotExpr,
|
state: State::NotExpr,
|
||||||
|
|
|
@ -75,7 +75,7 @@ pub(crate) fn single_file(code: &str) -> (ide_db::RootDatabase, FilePosition, Ve
|
||||||
match range_or_offset {
|
match range_or_offset {
|
||||||
RangeOrOffset::Range(range) => {
|
RangeOrOffset::Range(range) => {
|
||||||
position = FilePosition { file_id, offset: range.start() };
|
position = FilePosition { file_id, offset: range.start() };
|
||||||
selections = vec![FileRange { file_id, range: range }];
|
selections = vec![FileRange { file_id, range }];
|
||||||
}
|
}
|
||||||
RangeOrOffset::Offset(offset) => {
|
RangeOrOffset::Offset(offset) => {
|
||||||
position = FilePosition { file_id, offset };
|
position = FilePosition { file_id, offset };
|
||||||
|
|
|
@ -55,7 +55,7 @@ pub(super) fn transcribe(
|
||||||
template: &MetaTemplate,
|
template: &MetaTemplate,
|
||||||
bindings: &Bindings,
|
bindings: &Bindings,
|
||||||
) -> ExpandResult<tt::Subtree> {
|
) -> ExpandResult<tt::Subtree> {
|
||||||
let mut ctx = ExpandCtx { bindings: bindings, nesting: Vec::new() };
|
let mut ctx = ExpandCtx { bindings, nesting: Vec::new() };
|
||||||
let mut arena: Vec<tt::TokenTree> = Vec::new();
|
let mut arena: Vec<tt::TokenTree> = Vec::new();
|
||||||
expand_subtree(&mut ctx, template, None, &mut arena)
|
expand_subtree(&mut ctx, template, None, &mut arena)
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,7 @@ impl<'a> Iterator for Children<'a> {
|
||||||
impl Diagnostic {
|
impl Diagnostic {
|
||||||
/// Creates a new diagnostic with the given `level` and `message`.
|
/// Creates a new diagnostic with the given `level` and `message`.
|
||||||
pub fn new<T: Into<String>>(level: Level, message: T) -> Diagnostic {
|
pub fn new<T: Into<String>>(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
|
/// Creates a new diagnostic with the given `level` and `message` pointing to
|
||||||
|
@ -102,7 +102,7 @@ impl Diagnostic {
|
||||||
T: Into<String>,
|
T: Into<String>,
|
||||||
{
|
{
|
||||||
Diagnostic {
|
Diagnostic {
|
||||||
level: level,
|
level,
|
||||||
message: message.into(),
|
message: message.into(),
|
||||||
spans: spans.into_spans(),
|
spans: spans.into_spans(),
|
||||||
children: vec![],
|
children: vec![],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue