diff --git a/crates/lumio-codec/src/resource.rs b/crates/lumio-codec/src/resource.rs index bbb9724..9c99f9e 100644 --- a/crates/lumio-codec/src/resource.rs +++ b/crates/lumio-codec/src/resource.rs @@ -11,6 +11,12 @@ pub struct CodecWorkspace { scratch: Mutex>, } +impl Default for CodecWorkspace { + fn default() -> Self { + Self::new() + } +} + impl CodecWorkspace { pub fn new() -> Self { Self { @@ -41,6 +47,12 @@ pub struct CodecResource { destroyed: AtomicBool, } +impl Default for CodecResource { + fn default() -> Self { + Self::new() + } +} + impl CodecResource { pub fn new() -> Self { Self { diff --git a/crates/lumio-job/src/cancel.rs b/crates/lumio-job/src/cancel.rs index 55dd99e..1fa58bb 100644 --- a/crates/lumio-job/src/cancel.rs +++ b/crates/lumio-job/src/cancel.rs @@ -16,6 +16,12 @@ pub struct CancellationView { flag: Arc, } +impl Default for CancellationSource { + fn default() -> Self { + Self::new() + } +} + impl CancellationSource { pub fn new() -> Self { Self { diff --git a/crates/lumio-job/src/operation.rs b/crates/lumio-job/src/operation.rs index 9a942c2..c703cca 100644 --- a/crates/lumio-job/src/operation.rs +++ b/crates/lumio-job/src/operation.rs @@ -17,6 +17,12 @@ pub struct OperationRegistry { kernels: HashMap>, } +impl Default for OperationRegistry { + fn default() -> Self { + Self::new() + } +} + impl OperationRegistry { pub fn new() -> Self { Self { diff --git a/crates/lumio-kernel/src/context/registry.rs b/crates/lumio-kernel/src/context/registry.rs index e63d16a..c49363a 100644 --- a/crates/lumio-kernel/src/context/registry.rs +++ b/crates/lumio-kernel/src/context/registry.rs @@ -15,6 +15,12 @@ pub struct ResourceRegistry { items: Mutex>>, } +impl Default for ResourceRegistry { + fn default() -> Self { + Self::new() + } +} + impl ResourceRegistry { pub fn new() -> Self { Self { diff --git a/crates/lumio-platform/Cargo.toml b/crates/lumio-platform/Cargo.toml index 0742fd2..e7bd235 100644 --- a/crates/lumio-platform/Cargo.toml +++ b/crates/lumio-platform/Cargo.toml @@ -3,5 +3,10 @@ name = "lumio-platform" version.workspace = true edition.workspace = true publish.workspace = true +# `benches/clock.rs` is compiled as a `cfg(test)` module via `#[path]` from `lib.rs` +# (criterion is not approved; EXTERNAL_ALLOWLIST is empty). Cargo's bench +# auto-discovery would additionally register it as a bench target, where its +# `use crate::{..}` does not resolve (E0432) and `--all-targets` fails. +autobenches = false [dependencies] diff --git a/crates/lumio-platform/src/clock.rs b/crates/lumio-platform/src/clock.rs index a95c60f..2184642 100644 --- a/crates/lumio-platform/src/clock.rs +++ b/crates/lumio-platform/src/clock.rs @@ -65,6 +65,12 @@ pub struct StdMonotonicClock { epoch: Instant, } +impl Default for StdMonotonicClock { + fn default() -> Self { + Self::new() + } +} + impl StdMonotonicClock { pub fn new() -> Self { Self { diff --git a/crates/lumio-spatial/src/index/grid_reference.rs b/crates/lumio-spatial/src/index/grid_reference.rs index 1446589..b5cd3dc 100644 --- a/crates/lumio-spatial/src/index/grid_reference.rs +++ b/crates/lumio-spatial/src/index/grid_reference.rs @@ -14,6 +14,12 @@ pub struct GridReferenceIndex { objects: BTreeMap, } +impl Default for GridReferenceIndex { + fn default() -> Self { + Self::new() + } +} + impl GridReferenceIndex { pub fn new() -> Self { Self { diff --git a/crates/lumio-spatial/src/index/rstar_adapter.rs b/crates/lumio-spatial/src/index/rstar_adapter.rs index 846329e..76433dc 100644 --- a/crates/lumio-spatial/src/index/rstar_adapter.rs +++ b/crates/lumio-spatial/src/index/rstar_adapter.rs @@ -18,6 +18,12 @@ pub struct RStarIndexAdapter { inner: GridReferenceIndex, } +impl Default for RStarIndexAdapter { + fn default() -> Self { + Self::new() + } +} + impl RStarIndexAdapter { pub fn new() -> Self { Self { diff --git a/crates/lumio-spatial/src/query.rs b/crates/lumio-spatial/src/query.rs index c6c7d94..d34e066 100644 --- a/crates/lumio-spatial/src/query.rs +++ b/crates/lumio-spatial/src/query.rs @@ -23,6 +23,12 @@ pub struct SpatialContext { index: GridReferenceIndex, } +impl Default for SpatialContext { + fn default() -> Self { + Self::new() + } +} + impl SpatialContext { pub fn new() -> Self { Self { diff --git a/crates/lumio-spatial/src/resource.rs b/crates/lumio-spatial/src/resource.rs index d5536ef..c1c7b66 100644 --- a/crates/lumio-spatial/src/resource.rs +++ b/crates/lumio-spatial/src/resource.rs @@ -14,6 +14,12 @@ pub struct SpatialResource { destroyed: AtomicBool, } +impl Default for SpatialResource { + fn default() -> Self { + Self::new() + } +} + impl SpatialResource { pub fn new() -> Self { Self { diff --git a/crates/lumio-test-support/src/fixtures.rs b/crates/lumio-test-support/src/fixtures.rs index d4b9517..7b7dd0b 100644 --- a/crates/lumio-test-support/src/fixtures.rs +++ b/crates/lumio-test-support/src/fixtures.rs @@ -9,6 +9,12 @@ pub struct FixtureLoader { _private: (), } +impl Default for FixtureLoader { + fn default() -> Self { + Self::new() + } +} + impl FixtureLoader { pub fn new() -> Self { Self { _private: () } @@ -29,6 +35,12 @@ pub struct FaultPlan { _private: (), } +impl Default for FaultPlan { + fn default() -> Self { + Self::new() + } +} + impl FaultPlan { pub fn new() -> Self { Self { _private: () } @@ -40,6 +52,12 @@ pub struct PanicProbe { _private: (), } +impl Default for PanicProbe { + fn default() -> Self { + Self::new() + } +} + impl PanicProbe { pub fn new() -> Self { Self { _private: () } diff --git a/xtask/src/baseline.rs b/xtask/src/baseline.rs index cbb6fb0..3776209 100644 --- a/xtask/src/baseline.rs +++ b/xtask/src/baseline.rs @@ -41,12 +41,12 @@ fn must_not_contain(errors: &mut Vec, rel: &str, body: &str, needle: &st /// SHA-256 hex of `path` via `sha256sum` (CI) or `certutil` (Windows). pub fn file_sha256_hex(path: &Path) -> Result { - if let Ok(out) = Command::new("sha256sum").arg(path).output() { - if out.status.success() { - let text = String::from_utf8_lossy(&out.stdout); - if let Some(hex) = text.split_whitespace().next() { - return Ok(hex.to_ascii_lowercase()); - } + if let Ok(out) = Command::new("sha256sum").arg(path).output() + && out.status.success() + { + let text = String::from_utf8_lossy(&out.stdout); + if let Some(hex) = text.split_whitespace().next() { + return Ok(hex.to_ascii_lowercase()); } } let out = Command::new("certutil")