style: apply nix fmt

This commit is contained in:
müde 2026-07-05 22:24:42 +02:00
commit e1e3bda94a
7 changed files with 22 additions and 10 deletions

View file

@ -58,7 +58,10 @@ impl Claude {
})?;
if let Some(mut stdin) = child.stdin.take() {
stdin.write_all(prompt.as_bytes()).await.map_err(Error::Stdin)?;
stdin
.write_all(prompt.as_bytes())
.await
.map_err(Error::Stdin)?;
// Best-effort flush/close; claude sees EOF and starts the turn.
stdin.shutdown().await.ok();
}

View file

@ -41,7 +41,11 @@ impl CompactionPolicy for PercentPolicy {
if self.percent == 0 {
return false;
}
let Some(window) = usage.context_window.or(self.default_window).filter(|&w| w > 0) else {
let Some(window) = usage
.context_window
.or(self.default_window)
.filter(|&w| w > 0)
else {
return false;
};
usage.context_tokens.saturating_mul(100) >= u64::from(self.percent) * window

View file

@ -4,7 +4,9 @@ use std::sync::Mutex;
use serde_json::Value;
use crate::{Attach, Claude, CompactionPolicy, Config, Error, Result, SessionStore, Sink, Telemetry};
use crate::{
Attach, Claude, CompactionPolicy, Config, Error, Result, SessionStore, Sink, Telemetry,
};
/// A named claude session that outlives the model's context window by
/// compacting itself. Bundles the three things a durable session needs: