Take rustfmt's defaults

The code was hand-formatted -- close to rustfmt's output but not it, mostly
in keeping chains and call arguments on one line where the formatter would
break them. That is a per-line decision every future change has to make
again, and reproducing it would mean a config whose only job is to preserve
how the code already looks.

So this is `cargo fmt` at its defaults, with no rustfmt.toml, which is
where the sibling dev-updater checkout already sits: it is clean at the
defaults today, so the two repos now agree on layout without either of them
configuring it.

Formatting only -- no behaviour, no renames, nothing reordered. Verified
after: cargo test (35 pass), cargo clippy --all-targets clean, cargo fmt
--check clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xn8nHw1tw1R6PtiY1eEtw
This commit is contained in:
irisandClaude Opus 5 committed 2026-08-28 03:13:36 -04:00
1 parent f014094fcd
commit c12ab7f098
13 files changed
+557 -190

No files matched your search

+26 -10
View File
@@ -57,7 +57,9 @@ fn xdg_dir(base: Option<std::ffi::OsString>, fallback: &str) -> PathBuf {
base.map(PathBuf::from)
.filter(|path| path.is_absolute())
.unwrap_or_else(|| {
std::env::home_dir().unwrap_or_else(|| PathBuf::from(".")).join(fallback)
std::env::home_dir()
.unwrap_or_else(|| PathBuf::from("."))
.join(fallback)
})
.join("ai-app")
}
@@ -171,8 +173,12 @@ async fn main() -> Result<()> {
tracing_subscriber::fmt().with_env_filter("info").init();
let args = Args::parse();
let config_path = args.config.unwrap_or_else(|| config_home().join("config.ron"));
let data_dir = args.data_dir.unwrap_or_else(|| data_home().join("sessions"));
let config_path = args
.config
.unwrap_or_else(|| config_home().join("config.ron"));
let data_dir = args
.data_dir
.unwrap_or_else(|| data_home().join("sessions"));
let manager = Arc::new(
SessionManager::new(config_path.clone(), data_dir)
.with_context(|| format!("failed to load {}", config_path.display()))?,
@@ -185,7 +191,12 @@ async fn main() -> Result<()> {
tracing::info!(" host {} -> {}", host.name, host.address);
}
for info in manager.sessions() {
tracing::info!(" session {} ({}, {:?})", info.id, info.provider, info.status);
tracing::info!(
" session {} ({}, {:?})",
info.id,
info.provider,
info.status
);
}
// Before the interface check below, deliberately: the certificates are
@@ -237,11 +248,13 @@ async fn main() -> Result<()> {
.await
.context("failed to load TLS cert/key")?;
let monitor = Arc::new(usage::UsageMonitor::new(vec![Box::new(usage::ClaudeUsage {
credentials_path: std::env::home_dir()
.unwrap_or_else(|| PathBuf::from("/"))
.join(".claude/.credentials.json"),
})]));
let monitor = Arc::new(usage::UsageMonitor::new(vec![Box::new(
usage::ClaudeUsage {
credentials_path: std::env::home_dir()
.unwrap_or_else(|| PathBuf::from("/"))
.join(".claude/.credentials.json"),
},
)]));
// The bearer-token middleware wraps the entire router -- routes and
// fallback alike -- here and only here, so a new route can't forget
@@ -281,6 +294,9 @@ mod tests {
// Relative values are ignored per the spec, rather than resolving
// against whatever the working directory happens to be -- so a
// relative setting lands on the same path as no setting at all.
assert_eq!(xdg_dir(Some("relative/path".into()), ".config"), home_fallback);
assert_eq!(
xdg_dir(Some("relative/path".into()), ".config"),
home_fallback
);
}
}