Fix a bunch of other low-hanging style lints (#36498)
- **Fix a bunch of low hanging style lints like unnecessary-return** - **Fix single worktree violation** - **And the rest** Release Notes: - N/A
This commit is contained in:
@@ -1149,7 +1149,7 @@ impl Buffer {
|
||||
// Insert the new text before any existing fragments within the range.
|
||||
if !new_text.is_empty() {
|
||||
let mut old_start = old_fragments.start().1;
|
||||
if old_fragments.item().map_or(false, |f| f.visible) {
|
||||
if old_fragments.item().is_some_and(|f| f.visible) {
|
||||
old_start += fragment_start.0 - old_fragments.start().0.full_offset().0;
|
||||
}
|
||||
let new_start = new_fragments.summary().text.visible;
|
||||
@@ -1834,7 +1834,7 @@ impl Buffer {
|
||||
let mut edits: Vec<(Range<usize>, Arc<str>)> = Vec::new();
|
||||
let mut last_end = None;
|
||||
for _ in 0..edit_count {
|
||||
if last_end.map_or(false, |last_end| last_end >= self.len()) {
|
||||
if last_end.is_some_and(|last_end| last_end >= self.len()) {
|
||||
break;
|
||||
}
|
||||
let new_start = last_end.map_or(0, |last_end| last_end + 1);
|
||||
@@ -2671,7 +2671,7 @@ impl<D: TextDimension + Ord, F: FnMut(&FragmentSummary) -> bool> Iterator for Ed
|
||||
|
||||
if pending_edit
|
||||
.as_ref()
|
||||
.map_or(false, |(change, _)| change.new.end < self.new_end)
|
||||
.is_some_and(|(change, _)| change.new.end < self.new_end)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user