Skip to content

Commit 0056c9e

Browse files
committed
fix(ci): clear clippy warnings (-D warnings)
- needless borrow (cli.rs test) + map_or->is_some_and (cli main) via clippy --fix - mcp tests: reword handler_env doc to drop the '+' markdown-list marker (doc_list_item_without_indentation), and #![allow(await_holding_lock)] on the tests module — the guard is intentionally held across .await to serialize handler tests on the current-thread runtime.
1 parent cc0ff89 commit 0056c9e

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

crates/tj-cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4325,7 +4325,7 @@ fn build_dream_inputs(
43254325
)?;
43264326
let tasks: Vec<_> = candidates
43274327
.into_iter()
4328-
.filter(|t| task_filter.map_or(true, |f| f == t.task_id))
4328+
.filter(|t| task_filter.is_none_or(|f| f == t.task_id))
43294329
.collect();
43304330
if tasks.is_empty() {
43314331
continue;

crates/tj-cli/tests/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4527,7 +4527,7 @@ fn export_memory_dry_run_prints_path_and_content_no_write() {
45274527
.args(["export-memory", "--task", &task_id, "--dry-run"])
45284528
.assert()
45294529
.success()
4530-
.stdout(contains(&format!("memory/tj-{task_id}-ship-x.md")))
4530+
.stdout(contains(format!("memory/tj-{task_id}-ship-x.md")))
45314531
.stdout(contains("name: ship-x"));
45324532

45334533
// Nothing written under the sandboxed Claude config dir.

crates/tj-mcp/src/main.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -743,12 +743,17 @@ async fn main() -> Result<()> {
743743

744744
#[cfg(test)]
745745
mod tests {
746+
// The handler tests intentionally hold the handler_env() mutex across
747+
// `.await` to serialize access to the process-global PROJECT_DIR_OVERRIDE
748+
// and XDG_DATA_HOME. On a current-thread runtime this is safe.
749+
#![allow(clippy::await_holding_lock)]
750+
746751
use super::*;
747752

748753
/// Handler tests touch process-global state (PROJECT_DIR_OVERRIDE OnceLock
749-
/// + XDG_DATA_HOME env), so they must run one at a time and share a single
750-
/// project dir. This guard serializes them and lazily pins the override +
751-
/// XDG to a single persistent tempdir for the whole test binary.
754+
/// and the XDG_DATA_HOME env var), so they must run one at a time and share
755+
/// a single project dir. This guard serializes them and lazily pins the
756+
/// override and XDG to a single persistent tempdir for the whole test binary.
752757
fn handler_env() -> std::sync::MutexGuard<'static, ()> {
753758
use std::sync::{Mutex, OnceLock};
754759
static LOCK: OnceLock<Mutex<()>> = OnceLock::new();

0 commit comments

Comments
 (0)