Auto-fix clippy::collapsible_if violations (#36428)

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz
2025-08-19 13:27:24 +00:00
committed by GitHub
parent 9e8ec72bd5
commit 8f567383e4
281 changed files with 6625 additions and 7086 deletions
+4 -4
View File
@@ -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
+15 -15
View File
@@ -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 {