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:
parent
69b1c6d6f5
commit
6825715503
147 changed files with 788 additions and 1042 deletions
|
@ -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>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue