From 24ebede9bbfcb49a289a855ba35f6ce67fd6e4d8 Mon Sep 17 00:00:00 2001 From: Andy Dixon Date: Thu, 8 Oct 2026 10:24:34 +0100 Subject: [PATCH] Placeholder net module Co-Authored-By: Claude --- src/lib.rs | 1 + src/net/mod.rs | 3 +++ src/store/mod.rs | 2 +- src/store/types.rs | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 src/net/mod.rs diff --git a/src/lib.rs b/src/lib.rs index 22a607c..b316d1e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,3 +15,4 @@ pub mod rng; pub mod secret; pub mod store; pub mod util; +pub mod net; diff --git a/src/net/mod.rs b/src/net/mod.rs new file mode 100644 index 0000000..38369af --- /dev/null +++ b/src/net/mod.rs @@ -0,0 +1,3 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +//! Network import: `add URL` and `mirror`. (Being written.) diff --git a/src/store/mod.rs b/src/store/mod.rs index c8aab58..a05dfca 100644 --- a/src/store/mod.rs +++ b/src/store/mod.rs @@ -765,7 +765,7 @@ fn write_filler(root: &Path, target: u64, pool: Arc, entropy: Entropy) -> let mut rng = entropy.rng(b"filler"); let throwaway = Identity::generate(&mut rng); let s = Store::new(root, throwaway, pool, true, entropy); - let upper = (target / 8).max(CHUNK_SIZE).min(1 << 30) as f64; + let upper = (target / 8).clamp(CHUNK_SIZE, 1 << 30) as f64; let count = FILLER_MIN + rng.below(FILLER_MAX - FILLER_MIN + 1); let mut cat = Catalogue::default(); let (mut i, mut total) = (0u64, 0u64); diff --git a/src/store/types.rs b/src/store/types.rs index 5eff7b6..b4a95f1 100644 --- a/src/store/types.rs +++ b/src/store/types.rs @@ -323,7 +323,7 @@ mod tests { let text = r["json"].as_str().unwrap(); assert_eq!( &enc[..], - text["{\"name\":".len()..text.find(",\"seed\"").unwrap()].as_bytes(), + &text.as_bytes()["{\"name\":".len()..text.find(",\"seed\"").unwrap()], "escaping of {n:?}" ); if VaultName::new(n).is_none() {