clippy: Fix redundant field names warnings (#31793)

This commit is contained in:
Oluwatobi Sofela 2024-03-21 00:05:29 +01:00 committed by GitHub
parent f55d1d288e
commit 2789e98876
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
97 changed files with 285 additions and 314 deletions

View file

@ -457,7 +457,7 @@ pub struct QuerySelectorIterator {
impl<'a> QuerySelectorIterator {
fn new(iter: TreeIterator, selectors: SelectorList<SelectorImpl>) -> QuerySelectorIterator {
QuerySelectorIterator {
selectors: selectors,
selectors,
iterator: iter,
}
}
@ -3247,21 +3247,11 @@ impl<'a> ChildrenMutation<'a> {
match (prev, next) {
(None, None) => ChildrenMutation::ReplaceAll {
removed: &[],
added: added,
},
(Some(prev), None) => ChildrenMutation::Append {
prev: prev,
added: added,
},
(None, Some(next)) => ChildrenMutation::Prepend {
added: added,
next: next,
},
(Some(prev), Some(next)) => ChildrenMutation::Insert {
prev: prev,
added: added,
next: next,
added,
},
(Some(prev), None) => ChildrenMutation::Append { prev, added },
(None, Some(next)) => ChildrenMutation::Prepend { added, next },
(Some(prev), Some(next)) => ChildrenMutation::Insert { prev, added, next },
}
}
@ -3275,14 +3265,14 @@ impl<'a> ChildrenMutation<'a> {
if let (None, None) = (prev, next) {
ChildrenMutation::ReplaceAll {
removed: from_ref(removed),
added: added,
added,
}
} else {
ChildrenMutation::Replace {
prev: prev,
prev,
removed: *removed,
added: added,
next: next,
added,
next,
}
}
} else {
@ -3291,10 +3281,7 @@ impl<'a> ChildrenMutation<'a> {
}
fn replace_all(removed: &'a [&'a Node], added: &'a [&'a Node]) -> ChildrenMutation<'a> {
ChildrenMutation::ReplaceAll {
removed: removed,
added: added,
}
ChildrenMutation::ReplaceAll { removed, added }
}
/// Get the child that follows the added or removed children.
@ -3414,9 +3401,9 @@ impl<'a> UnbindContext<'a> {
) -> Self {
UnbindContext {
index: Cell::new(cached_index),
parent: parent,
prev_sibling: prev_sibling,
next_sibling: next_sibling,
parent,
prev_sibling,
next_sibling,
tree_connected: parent.is_connected(),
tree_in_doc: parent.is_in_doc(),
}