Fix most of the warnings

This commit is contained in:
Antonio Scandurra 2023-04-14 10:51:53 +02:00
parent 5666e8301e
commit 7394bf1cdc
13 changed files with 44 additions and 61 deletions

View file

@ -219,7 +219,7 @@ fn main() {
cx.spawn(|cx| handle_cli_connection(connection, app_state.clone(), cx))
.detach();
} else if let Ok(Some(paths)) = open_paths_rx.try_next() {
cx.update(|cx| workspace::open_paths(&paths, &app_state, None, cx))
cx.update(|cx| workspace::open_paths(&paths, &app_state, cx))
.detach();
} else {
cx.spawn({
@ -243,7 +243,7 @@ fn main() {
let app_state = app_state.clone();
async move {
while let Some(paths) = open_paths_rx.next().await {
cx.update(|cx| workspace::open_paths(&paths, &app_state, None, cx))
cx.update(|cx| workspace::open_paths(&paths, &app_state, cx))
.detach();
}
}
@ -607,7 +607,7 @@ async fn handle_cli_connection(
paths
};
let (workspace, items) = cx
.update(|cx| workspace::open_paths(&paths, &app_state, None, cx))
.update(|cx| workspace::open_paths(&paths, &app_state, cx))
.await;
let mut errored = false;

View file

@ -703,14 +703,13 @@ mod tests {
open_paths(
&[PathBuf::from("/root/a"), PathBuf::from("/root/b")],
&app_state,
None,
cx,
)
})
.await;
assert_eq!(cx.window_ids().len(), 1);
cx.update(|cx| open_paths(&[PathBuf::from("/root/a")], &app_state, None, cx))
cx.update(|cx| open_paths(&[PathBuf::from("/root/a")], &app_state, cx))
.await;
assert_eq!(cx.window_ids().len(), 1);
let workspace_1 = cx
@ -728,7 +727,6 @@ mod tests {
open_paths(
&[PathBuf::from("/root/b"), PathBuf::from("/root/c")],
&app_state,
None,
cx,
)
})
@ -741,7 +739,6 @@ mod tests {
open_paths(
&[PathBuf::from("/root/c"), PathBuf::from("/root/d")],
&app_state,
Some(window_id),
cx,
)
})
@ -771,7 +768,7 @@ mod tests {
.insert_tree("/root", json!({"a": "hey"}))
.await;
cx.update(|cx| open_paths(&[PathBuf::from("/root/a")], &app_state, None, cx))
cx.update(|cx| open_paths(&[PathBuf::from("/root/a")], &app_state, cx))
.await;
assert_eq!(cx.window_ids().len(), 1);
@ -813,7 +810,7 @@ mod tests {
assert!(!cx.is_window_edited(workspace.window_id()));
// Opening the buffer again doesn't impact the window's edited state.
cx.update(|cx| open_paths(&[PathBuf::from("/root/a")], &app_state, None, cx))
cx.update(|cx| open_paths(&[PathBuf::from("/root/a")], &app_state, cx))
.await;
let editor = workspace.read_with(cx, |workspace, cx| {
workspace