Auto-fix clippy::collapsible_if violations (#36428)
Release Notes: - N/A
This commit is contained in:
parent
9e8ec72bd5
commit
8f567383e4
281 changed files with 6628 additions and 7089 deletions
|
@ -530,10 +530,10 @@ where
|
|||
debug_assert!(self.stack.is_empty() || self.stack.last().unwrap().tree.0.is_leaf());
|
||||
|
||||
let mut end = self.position.clone();
|
||||
if bias == Bias::Left {
|
||||
if let Some(summary) = self.item_summary() {
|
||||
end.add_summary(summary, self.cx);
|
||||
}
|
||||
if bias == Bias::Left
|
||||
&& let Some(summary) = self.item_summary()
|
||||
{
|
||||
end.add_summary(summary, self.cx);
|
||||
}
|
||||
|
||||
target.cmp(&end, self.cx) == Ordering::Equal
|
||||
|
|
|
@ -674,11 +674,11 @@ impl<T: KeyedItem> SumTree<T> {
|
|||
*self = {
|
||||
let mut cursor = self.cursor::<T::Key>(cx);
|
||||
let mut new_tree = cursor.slice(&item.key(), Bias::Left);
|
||||
if let Some(cursor_item) = cursor.item() {
|
||||
if cursor_item.key() == item.key() {
|
||||
replaced = Some(cursor_item.clone());
|
||||
cursor.next();
|
||||
}
|
||||
if let Some(cursor_item) = cursor.item()
|
||||
&& cursor_item.key() == item.key()
|
||||
{
|
||||
replaced = Some(cursor_item.clone());
|
||||
cursor.next();
|
||||
}
|
||||
new_tree.push(item, cx);
|
||||
new_tree.append(cursor.suffix(), cx);
|
||||
|
@ -692,11 +692,11 @@ impl<T: KeyedItem> SumTree<T> {
|
|||
*self = {
|
||||
let mut cursor = self.cursor::<T::Key>(cx);
|
||||
let mut new_tree = cursor.slice(key, Bias::Left);
|
||||
if let Some(item) = cursor.item() {
|
||||
if item.key() == *key {
|
||||
removed = Some(item.clone());
|
||||
cursor.next();
|
||||
}
|
||||
if let Some(item) = cursor.item()
|
||||
&& item.key() == *key
|
||||
{
|
||||
removed = Some(item.clone());
|
||||
cursor.next();
|
||||
}
|
||||
new_tree.append(cursor.suffix(), cx);
|
||||
new_tree
|
||||
|
@ -736,11 +736,11 @@ impl<T: KeyedItem> SumTree<T> {
|
|||
old_item = cursor.item();
|
||||
}
|
||||
|
||||
if let Some(old_item) = old_item {
|
||||
if old_item.key() == new_key {
|
||||
removed.push(old_item.clone());
|
||||
cursor.next();
|
||||
}
|
||||
if let Some(old_item) = old_item
|
||||
&& old_item.key() == new_key
|
||||
{
|
||||
removed.push(old_item.clone());
|
||||
cursor.next();
|
||||
}
|
||||
|
||||
match edit {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue