Rewrite vault in Rust (format-compatible with 0.5) #1
@@ -15,3 +15,4 @@ pub mod rng;
|
||||
pub mod secret;
|
||||
pub mod store;
|
||||
pub mod util;
|
||||
pub mod net;
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
//! Network import: `add URL` and `mirror`. (Being written.)
|
||||
+1
-1
@@ -765,7 +765,7 @@ fn write_filler(root: &Path, target: u64, pool: Arc<Pool>, 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);
|
||||
|
||||
+1
-1
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user