From 464c4aa0d1f60256017e9cd952dd5d976e61c0c1 Mon Sep 17 00:00:00 2001 From: "claude[bot]" Date: Thu, 19 Feb 2026 16:05:58 +0000 Subject: [PATCH] fix: apply cargo fmt formatting to fc-agent/src/output.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- fc-agent/src/output.rs | 48 +++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/fc-agent/src/output.rs b/fc-agent/src/output.rs index 84d96e09..16a1cd87 100644 --- a/fc-agent/src/output.rs +++ b/fc-agent/src/output.rs @@ -77,7 +77,10 @@ async fn try_reconnect() -> Option { } Err(e) => { if attempt == 30 { - eprintln!("[fc-agent] output vsock reconnect failed after 30 attempts: {}", e); + eprintln!( + "[fc-agent] output vsock reconnect failed after 30 attempts: {}", + e + ); } else { tokio::time::sleep(std::time::Duration::from_millis(100)).await; } @@ -284,20 +287,20 @@ mod tests { // Notify should have exactly one stored permit (second notify_one is a no-op // when no waiter exists and permit already stored) - let notified = tokio::time::timeout( - std::time::Duration::from_millis(50), - notify.notified(), - ) - .await; - assert!(notified.is_ok(), "first notified() should return immediately"); + let notified = + tokio::time::timeout(std::time::Duration::from_millis(50), notify.notified()).await; + assert!( + notified.is_ok(), + "first notified() should return immediately" + ); // No second permit - let notified2 = tokio::time::timeout( - std::time::Duration::from_millis(50), - notify.notified(), - ) - .await; - assert!(notified2.is_err(), "second notified() should timeout (no stored permit)"); + let notified2 = + tokio::time::timeout(std::time::Duration::from_millis(50), notify.notified()).await; + assert!( + notified2.is_err(), + "second notified() should timeout (no stored permit)" + ); } /// Verify the Notify stored-permit cascade bug is fixed. @@ -317,23 +320,20 @@ mod tests { notify.notify_one(); // Simulate: writer's select! consumes the permit - let consumed = tokio::time::timeout( - std::time::Duration::from_millis(50), - notify.notified(), - ) - .await; + let consumed = + tokio::time::timeout(std::time::Duration::from_millis(50), notify.notified()).await; assert!(consumed.is_ok(), "should consume the stored permit"); // OLD CODE would do: notify.notify_one() here (re-store) // NEW CODE does NOT re-store. // Verify: no ghost permit exists - let ghost = tokio::time::timeout( - std::time::Duration::from_millis(50), - notify.notified(), - ) - .await; - assert!(ghost.is_err(), "no ghost permit should exist after consuming"); + let ghost = + tokio::time::timeout(std::time::Duration::from_millis(50), notify.notified()).await; + assert!( + ghost.is_err(), + "no ghost permit should exist after consuming" + ); } /// Verify that messages queued during reconnection are not lost.