Skip to content

Commit 626bb28

Browse files
committed
Fix the one CI-mandatory 1.97 lint: clippy::some_filter in deepnsm
CI clippy went red on ONE error, and it corrects something I said earlier in this arc: I reported 1.97.1 as adding "no new lint surface". It does — clippy::some_filter is new in 1.97, and this is the proof. My claim was true only of the crates I had scoped, which is a narrower statement than the one I made. Why the -p sweep never saw it: deepnsm is workspace-EXCLUDED, so no -p run reaches it; CI checks it by --manifest-path. Reading the CI config rather than guessing also showed the gate is TIERED — lance-graph-contract, deepnsm and deepnsm-v2 are MANDATORY while lance-graph and bgz-tensor are advisory — so only the mandatory set had to move. Verified all three mandatory manifests: 0 errors; deepnsm tests 217 + 4 + 8 + 2 green. The fix is simpler than clippy's own suggestion and equivalent: animate.or(Some(false).filter(|_| animate.is_none())) is just animate.or(Some(false)). Option::or already discards its argument when self is Some, so the filter's predicate could only ever be true on the None branch — where the filter is a no-op. Clippy proposed animate.is_none().then_some(false), which is also correct but keeps a condition that cannot change the result. Recorded, NOT fixed (deliberately): the ungated/advisory excluded crates carry pre-existing clippy debt — bgz17 27, lance-graph-codec-research 55, bgz-tensor 10 (advisory) — mostly needless_range_loop. CI does not gate bgz17 or codec-research at all, and the workflow's own comments already describe ~91 pre-existing lance-graph violations as debt to be paid down over time. Fixing 92 unrelated lints inside a dependency-bump PR would bury the bump; they belong in their own pass.
1 parent fc28eb1 commit 626bb28

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎crates/deepnsm/examples/spo_anaphora_nibble.rs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ fn resolve(stream: &[&str], pos: usize, p: Pron) -> Option<usize> {
155155
nf.plural == plural && want_anim.is_none_or(|a| nf.animate == a)
156156
};
157157
// pass 1: strict animacy (it -> inanimate)
158-
let want = animate.or(Some(false).filter(|_| animate.is_none()));
158+
// Keep the pronoun's own animacy when it has one; an unmarked pronoun
159+
// (`it`) starts as inanimate. Same value as the previous
160+
// `.or(Some(false).filter(|_| animate.is_none()))`, without evaluating a
161+
// filter whose predicate can only be true on the None branch.
162+
let want = animate.or(Some(false));
159163
for &k in &cands {
160164
if let Some(nf) = noun_features(stream[k]) {
161165
if agrees(&nf, want) {

0 commit comments

Comments
 (0)