clippy::redundant_field_names

This commit is contained in:
Maan2003 2021-06-13 09:40:22 +05:30
parent b857a5dcf0
commit aabd41cafc
No known key found for this signature in database
GPG Key ID: E9AF024BA63C70ED
6 changed files with 7 additions and 7 deletions

View File

@ -275,7 +275,7 @@ pub(super) fn infer_pat(
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

View File

@ -292,7 +292,7 @@ pub(crate) fn replace_ast<N: AstNode>(&mut self, old: N, new: N) {
}
pub(crate) fn create_file(&mut self, dst: AnchoredPathBuf, content: impl Into<String>) {
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);
}

View File

@ -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,

View File

@ -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 };

View File

@ -55,7 +55,7 @@ pub(super) fn transcribe(
template: &MetaTemplate,
bindings: &Bindings,
) -> 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();
expand_subtree(&mut ctx, template, None, &mut arena)
}

View File

@ -91,7 +91,7 @@ fn next(&mut self) -> Option<Self::Item> {
impl Diagnostic {
/// Creates a new diagnostic with the given `level` and `message`.
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
@ -102,7 +102,7 @@ pub fn spanned<S, T>(spans: S, level: Level, message: T) -> Diagnostic
T: Into<String>,
{
Diagnostic {
level: level,
level,
message: message.into(),
spans: spans.into_spans(),
children: vec![],