You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
aimdb-sync is std-only today. Before it can become #![no_std] (tracked in #46) a handful of std-crates have to go. They are independent of each other and small enough to land as one PR.
Fix any fallout in aimdb-sync/src/error.rs (2.x is largely source-compatible — #[error(transparent)] and #[from] both still work).
The Phase 1 checklist comment on #46 says thiserror "appears unused" — that is not correct. It is used at aimdb-sync/src/error.rs:10, which derives it on SyncError. So this is a bump, not a removal.
Leave the String fields in SyncError alone; switching them to alloc::string::String belongs to the no_std flip (Phase 1b).
2. Replace eprintln! with the log facade
Replace the 11 eprintln! calls in aimdb-sync/src/handle.rs with the workspace log macros (log_warn! / log_error!), picking the level that matches each message.
The macros are #[macro_export]ed from aimdb-core/src/log.rs:35 / :44; add the import if needed.
Keep the message text as-is — this is a routing change, not a rewording.
The #46 comment counts 13 sites. Only these 11 are real code; the two in lib.rs:231-232 sit inside a //! doc example and are covered by item 3.
3. Drop std::error::Error from the doctests
Rewrite the ~16 Result<(), Box<dyn std::error::Error>> doctest signatures to use the crate's own SyncResult / SyncError, or gate the examples behind the (future) std feature.
Sites: producer.rs:27,127,163,200,244; consumer.rs:27,90,129,169,216,268; handle.rs:53,93,305,340,379,441,544,571; lib.rs:57,119,138 (plus the two eprintln!s in the lib.rs:231-232 example).
Examples that pull in aimdb_tokio_adapter::TokioAdapter are std-only by construction — those are the ones to gate rather than rewrite.
Why it matters
std::error::Error, eprintln!, and thiserror 1.0 are the three hard no_std blockers that need no design decisions — clearing them shrinks Phase 1b to the parts that actually need thought.
Verification
cargo build -p aimdb-sync
cargo test -p aimdb-sync
cargo test --doc -p aimdb-sync
make check
examples/sync-api-demo must behave identically; check that the drop-without-detach warning (handle.rs:644) still surfaces.
Background
aimdb-syncis std-only today. Before it can become# a handful of std-crates have to go. They are independent of each other and small enough to land as one PR.Task
1. Bump
thiserrorto 2.xaimdb-sync/Cargo.toml:21:thiserror = "1.0"→thiserror = { version = "2.0.16", default-features = false }, mirroringaimdb-core/Cargo.toml:96.aimdb-sync/src/error.rs(2.x is largely source-compatible —#[error(transparent)]and#[from]both still work).Leave the
Stringfields inSyncErroralone; switching them toalloc::string::Stringbelongs to theno_stdflip (Phase 1b).2. Replace
eprintln!with the log facadeeprintln!calls inaimdb-sync/src/handle.rswith the workspace log macros (log_warn!/log_error!), picking the level that matches each message.handle.rslines 159, 169, 178, 185, 245, 485, 498, 509, 644, 645, 649.#[macro_export]ed fromaimdb-core/src/log.rs:35/:44; add the import if needed.3. Drop
std::error::Errorfrom the doctestsResult<(), Box<dyn std::error::Error>>doctest signatures to use the crate's ownSyncResult/SyncError, or gate the examples behind the (future)stdfeature.producer.rs:27,127,163,200,244;consumer.rs:27,90,129,169,216,268;handle.rs:53,93,305,340,379,441,544,571;lib.rs:57,119,138(plus the twoeprintln!s in thelib.rs:231-232example).aimdb_tokio_adapter::TokioAdapterare std-only by construction — those are the ones to gate rather than rewrite.Why it matters
std::error::Error,eprintln!, and thiserror 1.0 are the three hardno_stdblockers that need no design decisions — clearing them shrinks Phase 1b to the parts that actually need thought.Verification
examples/sync-api-demomust behave identically; check that the drop-without-detach warning (handle.rs:644) still surfaces.Files
aimdb-sync/Cargo.toml,aimdb-sync/src/{error,handle,producer,consumer,lib}.rsaimdb-core/Cargo.toml:96,aimdb-core/src/error.rs,aimdb-core/src/log.rs