diff options
| author | tv <tv@krebsco.de> | 2026-11-16 23:12:13 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-17 00:15:07 +0100 |
| commit | 25d99aa993f120c8f6796ea2d91f15c3c26b8201 (patch) | |
| tree | 1e9e8fd8b591f427deeccf919aacc1e53ae25000 /src/access | |
| parent | 8811b2ecaa93a0f9ff9238a19a9865f8cb0bdb5e (diff) | |
access: what a generated change picks from, given its type
The closed paths a generated write picks one of are an array of their own, and the
events a node put a slice: picked from an array written in place, a path's type is
left to be inferred from where it goes, which some compilers don't.
Diffstat (limited to 'src/access')
| -rw-r--r-- | src/access/holding.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/access/holding.rs b/src/access/holding.rs index 2d083ba..3820e79 100644 --- a/src/access/holding.rs +++ b/src/access/holding.rs @@ -374,7 +374,7 @@ mod tests { ); bytes }; - let some = rng.pick(written).clone(); + let some = rng.pick(written.as_slice()).clone(); let key = Id::of(&some).to_string(); let entry = |node: &str| meta::path(&[meta::MEMBERS, node]); match rng.below(10) { @@ -390,15 +390,14 @@ mod tests { 6 => store::delete_path(doc, &meta::path(&[meta::EVENTS, &key]), false)?, 7 => store::write_path(doc, &entry(node), &json!({"alias": node}))?, 8 => store::write_path(doc, &entry("node-elsewhere"), &json!({}))?, - _ => store::write_path( - doc, - rng.pick(&[ + _ => { + let closed: [Vec<String>; 3] = [ vec!["config".to_owned()], meta::path(&[meta::SWARM]), crate::access::policy::path(), - ]), - &json!(1), - )?, + ]; + store::write_path(doc, rng.pick(&closed), &json!(1))? + } } } Ok(()) |
