Another batch of lint fixes (#36521)

- **Enable a bunch of extra lints**
- **First batch of fixes**
- **More fixes**

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-08-19 22:33:44 +02:00 committed by GitHub
parent 69b1c6d6f5
commit 6825715503
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
147 changed files with 788 additions and 1042 deletions

View file

@ -255,16 +255,11 @@ impl MarksState {
pub fn new(workspace: &Workspace, cx: &mut App) -> Entity<MarksState> {
cx.new(|cx| {
let buffer_store = workspace.project().read(cx).buffer_store().clone();
let subscription =
cx.subscribe(
&buffer_store,
move |this: &mut Self, _, event, cx| match event {
project::buffer_store::BufferStoreEvent::BufferAdded(buffer) => {
this.on_buffer_loaded(buffer, cx);
}
_ => {}
},
);
let subscription = cx.subscribe(&buffer_store, move |this: &mut Self, _, event, cx| {
if let project::buffer_store::BufferStoreEvent::BufferAdded(buffer) = event {
this.on_buffer_loaded(buffer, cx);
}
});
let mut this = Self {
workspace: workspace.weak_handle(),
@ -596,7 +591,7 @@ impl MarksState {
if let Some(anchors) = self.buffer_marks.get(&buffer_id) {
let text_anchors = anchors.get(name)?;
let anchors = text_anchors
.into_iter()
.iter()
.map(|anchor| Anchor::in_buffer(excerpt_id, buffer_id, *anchor))
.collect();
return Some(Mark::Local(anchors));
@ -1710,26 +1705,25 @@ impl VimDb {
marks: HashMap<String, Vec<Point>>,
) -> Result<()> {
log::debug!("Setting path {path:?} for {} marks", marks.len());
let result = self
.write(move |conn| {
let mut query = conn.exec_bound(sql!(
INSERT OR REPLACE INTO vim_marks
(workspace_id, mark_name, path, value)
VALUES
(?, ?, ?, ?)
))?;
for (mark_name, value) in marks {
let pairs: Vec<(u32, u32)> = value
.into_iter()
.map(|point| (point.row, point.column))
.collect();
let serialized = serde_json::to_string(&pairs)?;
query((workspace_id, mark_name, path.clone(), serialized))?;
}
Ok(())
})
.await;
result
self.write(move |conn| {
let mut query = conn.exec_bound(sql!(
INSERT OR REPLACE INTO vim_marks
(workspace_id, mark_name, path, value)
VALUES
(?, ?, ?, ?)
))?;
for (mark_name, value) in marks {
let pairs: Vec<(u32, u32)> = value
.into_iter()
.map(|point| (point.row, point.column))
.collect();
let serialized = serde_json::to_string(&pairs)?;
query((workspace_id, mark_name, path.clone(), serialized))?;
}
Ok(())
})
.await
}
fn get_marks(&self, workspace_id: WorkspaceId) -> Result<Vec<SerializedMark>> {