Workspace lints and disallow unwrap (#855)
Sets submodules to use workspace lints. Added denying unwrap as a workspace level lint, which found a couple of cases where we could have propagated errors. Also manually labeled ones that were fine by my eye.
This commit is contained in:
@@ -7,6 +7,9 @@ edition = "2024"
|
||||
name = "codex_core"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1"
|
||||
async-channel = "2.3.1"
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Poisoned mutex should fail the program
|
||||
#![allow(clippy::unwrap_used)]
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::collections::HashSet;
|
||||
use std::path::Path;
|
||||
|
||||
@@ -351,5 +351,6 @@ fn synthetic_exit_status(code: i32) -> ExitStatus {
|
||||
#[cfg(windows)]
|
||||
fn synthetic_exit_status(code: i32) -> ExitStatus {
|
||||
use std::os::windows::process::ExitStatusExt;
|
||||
#[expect(clippy::unwrap_used)]
|
||||
std::process::ExitStatus::from_raw(code.try_into().unwrap())
|
||||
}
|
||||
|
||||
@@ -166,7 +166,9 @@ fn create_log_file() -> std::io::Result<LogFileInfo> {
|
||||
|
||||
// Custom format for YYYY-MM-DD.
|
||||
let format: &[FormatItem] = format_description!("[year]-[month]-[day]");
|
||||
let date_str = timestamp.format(format).unwrap();
|
||||
let date_str = timestamp
|
||||
.format(format)
|
||||
.map_err(|e| IoError::new(ErrorKind::Other, format!("failed to format timestamp: {e}")))?;
|
||||
|
||||
let filename = format!("rollout-{date_str}-{session_id}.jsonl");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user