From 13d303573f0772d4b636ce276ba5c4c18ccbcf0d Mon Sep 17 00:00:00 2001 From: lawrencecchen <54008264+lawrencecchen@users.noreply.github.com> Date: Wed, 4 Nov 2026 19:38:39 +0000 Subject: [PATCH] base red: rustfmt the 4 cmux-tui files left unformatted by #34604, #35799 and #35341 cmux-tui-rust-check.sh fmt is red on feat-cmux-next 78fcd7c8257 (fleet step 95f2e1ad65b5194a3429b675): 9 diffs in link/sync_cli.rs, link/sync_cli/store.rs, cmux-tui-core lib.rs and apps/grants.rs. Every PR whose Rust check runs fmt inherits it (S3a e3538ce6 and a0d75c74 failed only on these files). Formatting only: rustfmt 1.95.0 with cmux-tui/rustfmt.toml, edition 2024. --- .../crates/cmux-tui-core/src/apps/grants.rs | 5 ++++- cmux-tui/crates/cmux-tui-core/src/lib.rs | 4 ++-- cmux-tui/crates/cmux-tui/src/link/sync_cli.rs | 13 +++++++++++-- .../crates/cmux-tui/src/link/sync_cli/store.rs | 17 +++++++++-------- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/cmux-tui/crates/cmux-tui-core/src/apps/grants.rs b/cmux-tui/crates/cmux-tui-core/src/apps/grants.rs index 8f2a21c5e0b3..589e92811717 100644 --- a/cmux-tui/crates/cmux-tui-core/src/apps/grants.rs +++ b/cmux-tui/crates/cmux-tui-core/src/apps/grants.rs @@ -346,7 +346,10 @@ mod tests { fn a_toast_needs_no_grant_but_not_a_preview_or_a_stopping_app() { let table = ScopeTable::get(); let params = json!({"title": "Saved"}); - assert_eq!(table.check("toast.show", ¶ms, &grant(&[])), Decision::Allow(OpClass::Mutation)); + assert_eq!( + table.check("toast.show", ¶ms, &grant(&[])), + Decision::Allow(OpClass::Mutation) + ); let preview = Grant { preview: true, ..grant(&[]) }; assert!(matches!(table.check("toast.show", ¶ms, &preview), Decision::ScopeMissing(_))); let revoked = Grant { revoked: true, ..grant(&[]) }; diff --git a/cmux-tui/crates/cmux-tui-core/src/lib.rs b/cmux-tui/crates/cmux-tui-core/src/lib.rs index 59bd97676aef..7a0e9bacf02e 100644 --- a/cmux-tui/crates/cmux-tui-core/src/lib.rs +++ b/cmux-tui/crates/cmux-tui-core/src/lib.rs @@ -34,6 +34,8 @@ mod conversation_search; mod conversation_store; pub mod daemon_env; use cmux_tui_util::debug_spans; +#[cfg(unix)] +pub mod blob_fetch; mod browser_profile_ops; mod browser_site_engines; pub mod diagnostics; @@ -42,8 +44,6 @@ mod event_bus; pub mod fs_ops; mod git_ops; #[cfg(unix)] -pub mod blob_fetch; -#[cfg(unix)] pub mod git_seed; mod history_ops; pub mod history_search; diff --git a/cmux-tui/crates/cmux-tui/src/link/sync_cli.rs b/cmux-tui/crates/cmux-tui/src/link/sync_cli.rs index 4652899029f2..f18af83aadaa 100644 --- a/cmux-tui/crates/cmux-tui/src/link/sync_cli.rs +++ b/cmux-tui/crates/cmux-tui/src/link/sync_cli.rs @@ -837,7 +837,10 @@ fn push_inner( for (path, revisions) in &left.written { let Some(relative) = path.strip_prefix(&prefix) else { continue }; if !plain_relative(relative) - || previous.files.get(relative).is_some_and(|pushed| revisions.contains(&pushed.revision)) + || previous + .files + .get(relative) + .is_some_and(|pushed| revisions.contains(&pushed.revision)) { continue; } @@ -939,7 +942,13 @@ fn push_inner( // Through the store, the machine fetches first; what it did not write // goes over the link below, like every other write. let fetched = if via_store { - Some(send_through_store(&mut remote, remote_root, &deferred, tally.done, &mut tally.progress)?) + Some(send_through_store( + &mut remote, + remote_root, + &deferred, + tally.done, + &mut tally.progress, + )?) } else { None }; diff --git a/cmux-tui/crates/cmux-tui/src/link/sync_cli/store.rs b/cmux-tui/crates/cmux-tui/src/link/sync_cli/store.rs index 58b3312b07a6..582ff3c9b887 100644 --- a/cmux-tui/crates/cmux-tui/src/link/sync_cli/store.rs +++ b/cmux-tui/crates/cmux-tui/src/link/sync_cli/store.rs @@ -140,7 +140,9 @@ pub(super) fn fence(remote: &mut Remote, remote_root: &str) -> anyhow::Result() .is_some_and(|refusal| refusal.code == "blob.no_job") => {} Err(error) => { - return Err(error.context("cannot read what the machine's earlier store fetch wrote")); + return Err( + error.context("cannot read what the machine's earlier store fetch wrote") + ); } } } @@ -163,8 +165,7 @@ fn written_by( ) -> anyhow::Result<()> { let mut from = 0u64; loop { - let page = - remote.call("blob.fetch.status", json!({ "job": job, "written_from": from }))?; + let page = remote.call("blob.fetch.status", json!({ "job": job, "written_from": from }))?; let entries = page.get("written").and_then(Value::as_array).cloned().unwrap_or_default(); for entry in &entries { if let (Some(path), Some(revision)) = ( @@ -450,10 +451,10 @@ pub(super) fn send( let Some(job) = started.get("job").and_then(Value::as_str).map(str::to_owned) else { return Err(match fence(remote, remote_root) { Ok(_) => anyhow!("blob.fetch.start answered no job"), - Err(fenced) => { - Unsettled(format!("blob.fetch.start answered no job; and the cancel failed: {fenced:#}")) - .into() - } + Err(fenced) => Unsettled(format!( + "blob.fetch.start answered no job; and the cancel failed: {fenced:#}" + )) + .into(), }); }; let deadline = Instant::now() + FETCH_DEADLINE; @@ -492,7 +493,7 @@ pub(super) fn send( written_by(remote, &job, &mut |path, revision| { sent.written.insert(path, revision); }) - .context("cannot read what the machine's fetch wrote")?; + .context("cannot read what the machine's fetch wrote")?; Ok(sent) }