chore: Fix several style lints (#17488)

It's not comprehensive enough to start linting on `style` group, but
hey, it's a start.

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz
2024-09-06 11:58:39 +02:00
committed by GitHub
parent 93249fc82b
commit e6c1c51b37
361 changed files with 3529 additions and 3586 deletions
@@ -120,8 +120,7 @@ impl EditorTestContext {
where
F: FnOnce(&Editor, &ViewContext<Editor>) -> T,
{
self.editor
.update(&mut self.cx, |this, cx| read(&this, &cx))
self.editor.update(&mut self.cx, |this, cx| read(this, cx))
}
#[track_caller]
@@ -327,8 +326,8 @@ impl EditorTestContext {
.background_highlights
.get(&TypeId::of::<Tag>())
.map(|h| h.1.clone())
.unwrap_or_else(|| Arc::default())
.into_iter()
.unwrap_or_default()
.iter()
.map(|range| range.to_offset(&snapshot.buffer_snapshot))
.collect()
});
@@ -424,6 +423,12 @@ pub struct AssertionContextManager {
contexts: Arc<RwLock<BTreeMap<usize, String>>>,
}
impl Default for AssertionContextManager {
fn default() -> Self {
Self::new()
}
}
impl AssertionContextManager {
pub fn new() -> Self {
Self {