lints: A bunch of extra style lint fixes (#36568)
- **lints: Fix 'doc_lazy_continuation'** - **lints: Fix 'doc_overindented_list_items'** - **inherent_to_string and io_other_error** - **Some more lint fixes** - **lints: enable bool_assert_comparison, match_like_matches_macro and wrong_self_convention** Release Notes: - N/A
This commit is contained in:
parent
a32a264508
commit
cf7c64d77f
92 changed files with 277 additions and 345 deletions
|
@ -2868,12 +2868,7 @@ mod tests {
|
|||
1,
|
||||
blocks
|
||||
.iter()
|
||||
.filter(|(_, block)| {
|
||||
match block {
|
||||
Block::FoldedBuffer { .. } => true,
|
||||
_ => false,
|
||||
}
|
||||
})
|
||||
.filter(|(_, block)| { matches!(block, Block::FoldedBuffer { .. }) })
|
||||
.count(),
|
||||
"Should have one folded block, producing a header of the second buffer"
|
||||
);
|
||||
|
|
|
@ -782,10 +782,7 @@ impl MinimapVisibility {
|
|||
}
|
||||
|
||||
fn disabled(&self) -> bool {
|
||||
match *self {
|
||||
Self::Disabled => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(*self, Self::Disabled)
|
||||
}
|
||||
|
||||
fn settings_visibility(&self) -> bool {
|
||||
|
|
|
@ -293,7 +293,7 @@ impl FollowableItem for Editor {
|
|||
EditorEvent::ExcerptsRemoved { ids, .. } => {
|
||||
update
|
||||
.deleted_excerpts
|
||||
.extend(ids.iter().map(ExcerptId::to_proto));
|
||||
.extend(ids.iter().copied().map(ExcerptId::to_proto));
|
||||
true
|
||||
}
|
||||
EditorEvent::ScrollPositionChanged { autoscroll, .. } if !autoscroll => {
|
||||
|
|
|
@ -67,10 +67,7 @@ impl ScrollAmount {
|
|||
}
|
||||
|
||||
pub fn is_full_page(&self) -> bool {
|
||||
match self {
|
||||
ScrollAmount::Page(count) if count.abs() == 1.0 => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(self, ScrollAmount::Page(count) if count.abs() == 1.0)
|
||||
}
|
||||
|
||||
pub fn direction(&self) -> ScrollDirection {
|
||||
|
|
|
@ -300,6 +300,7 @@ impl EditorLspTestContext {
|
|||
self.to_lsp_range(ranges[0].clone())
|
||||
}
|
||||
|
||||
#[expect(clippy::wrong_self_convention, reason = "This is test code")]
|
||||
pub fn to_lsp_range(&mut self, range: Range<usize>) -> lsp::Range {
|
||||
let snapshot = self.update_editor(|editor, window, cx| editor.snapshot(window, cx));
|
||||
let start_point = range.start.to_point(&snapshot.buffer_snapshot);
|
||||
|
@ -326,6 +327,7 @@ impl EditorLspTestContext {
|
|||
})
|
||||
}
|
||||
|
||||
#[expect(clippy::wrong_self_convention, reason = "This is test code")]
|
||||
pub fn to_lsp(&mut self, offset: usize) -> lsp::Position {
|
||||
let snapshot = self.update_editor(|editor, window, cx| editor.snapshot(window, cx));
|
||||
let point = offset.to_point(&snapshot.buffer_snapshot);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue