fix(#1375): clean up pedantic warnings and re-enable -D warnings without pedantic bypass

This commit is contained in:
damocles 2026-06-05 15:59:45 +02:00 committed by mara
commit fb726197ea
28 changed files with 109 additions and 90 deletions

View file

@ -49,7 +49,8 @@ fn now_unix() -> i64 {
SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap_or_default()
.as_secs() as i64
.as_secs()
.cast_signed()
}
/// Generate a task ID: `<timestamp_hex><seq_hex>`.
@ -112,7 +113,7 @@ fn refresh_loose_ends() {
let dest = dir.join("bash.json");
let tmp = dest.with_extension("json.tmp");
let json = serde_json::to_string(&items).unwrap_or_else(|_| "[]".to_owned());
if let Err(e) = std::fs::write(&tmp, &json).and_then(|_| std::fs::rename(&tmp, &dest)) {
if let Err(e) = std::fs::write(&tmp, &json).and_then(|()| std::fs::rename(&tmp, &dest)) {
tracing::warn!(error = ?e, "bash_runner: write mcp-loose-ends/bash.json failed");
}
}
@ -220,7 +221,7 @@ async fn run_loop(socket: PathBuf) {
let claimed: Arc<Mutex<HashSet<String>>> = Arc::new(Mutex::new(HashSet::new()));
loop {
poll_once(&socket, &claimed).await;
poll_once(&socket, &claimed);
tokio::time::sleep(POLL_INTERVAL).await;
}
}
@ -255,7 +256,7 @@ async fn mark_interrupted(socket: &Path) {
}
}
async fn poll_once(socket: &Path, claimed: &Arc<Mutex<HashSet<String>>>) {
fn poll_once(socket: &Path, claimed: &Arc<Mutex<HashSet<String>>>) {
let Ok(rd) = std::fs::read_dir(paths::tasks_dir()) else {
return;
};
@ -452,6 +453,8 @@ pub(crate) async fn send_wake(
summary: &str,
output: Option<(&str, &str)>,
) {
use tokio::io::{AsyncBufReadExt as _, BufReader};
use tokio::net::UnixStream;
let mut body = format!("bash task `{id}` finished: {summary}");
if let Some((stdout, stderr)) = output {
if !stdout.is_empty() {
@ -471,9 +474,6 @@ pub(crate) async fn send_wake(
transient: true,
};
use tokio::io::{AsyncBufReadExt as _, BufReader};
use tokio::net::UnixStream;
match UnixStream::connect(socket).await {
Ok(stream) => {
let (read, mut write) = stream.into_split();