Repository navigation
refactor(platform): Keep one due, not a copy per cfg arm - #923
Conversation
Both arms waited 500ms and marked the read. Only the refresh that follows differs, and that already lives at each call site. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
CLEARED @ SpecDone-when met:
StandardsLaziness Protocol: delete the copy, do not invent a platform trait. Comments on ProofCI green including windows (the real Soft: #915 is dirty against main and edits nearby Windows Do not merge without Oded’s explicit yes. After merge, #358 Remaining is empty → close #358 completed (Architect will update the issue body). — Cursor agent (Architect), on @omesser's behalf. |
Why
platform.rscarried two copies offn due, one under#[cfg(unix)]and oneunder
#[cfg(not(unix))]. Both wait 500ms and mark the read; the unix copyspelled the interval
USABLE_FRAME_REFRESHand the Windows copy inlinedDuration::from_millis(500). Item 8 of #358.What changed
One
due, no cfg, beside theUSABLE_FRAME_REFRESHit reads. The refresh thatfollows the check is what actually differs per platform, and it already sits at
each call site: macOS posts to the main thread, X11 and Windows read where they
stand. No trait and no type to express that (#172).
USABLE_FRAME_REFRESHlosesits
#[cfg(unix)]for the same reason.Not here: X11
window_class(#351, #356).How to verify
cargo test -p ai-buddy --all-targets(538 pass),cargo test -p ai-buddy-core,cargo clippy --all-targets -- -D warnings,node --test tests/*.test.js(304 pass), all on macOS.
The
not(unix)arm is not built here and I am not claiming it compiles.cargo check -p ai-buddy --target x86_64-pc-windows-msvcon this Mac dies inring's C build (fatal error: 'assert.h' file not found) long before itreaches
platform.rs. CI's windows job is the check that matters for it.Notes
#915 edits the Windows
window_sourcea few lines above the copy this deletes.Whichever lands second rebases.
Refs #358
— Claude Code agent, on @omesser's behalf.
🤖 Generated with Claude Code