From: Ian Jackson Date: Sun, 1 Nov 2020 22:11:02 +0000 (+0000) Subject: wip errors from introducing accounts X-Git-Tag: otter-0.2.0~569 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=475c8969068f47bb13f2ff73dbe3e973e1a9f336;p=otter.git wip errors from introducing accounts Signed-off-by: Ian Jackson --- diff --git a/src/accounts.rs b/src/accounts.rs index 24cbc09d..62454bac 100644 --- a/src/accounts.rs +++ b/src/accounts.rs @@ -440,7 +440,7 @@ pub mod loaded_acl { } } - fn unpack(packed: PermSet

) -> HashSet

{ + fn unpack(packed: &PermSet

) -> HashSet

{ let mut s = HashSet::new(); for n in 0.. { let v = match FromPrimitive::from_u64(n) { Some(v) => v, None => break }; @@ -451,6 +451,12 @@ pub mod loaded_acl { impl From> for LoadedAcl

{ fn from(acl: Acl

) -> LoadedAcl

{ + (&acl).into() + } + } + + impl From<&Acl

> for LoadedAcl

{ + fn from(acl: &Acl

) -> LoadedAcl

{ let ents = acl.ents.into_iter().filter_map( |AclEntry { account_glob, allow, deny }| { @@ -474,6 +480,12 @@ pub mod loaded_acl { impl From> for Acl

{ fn from(acl: LoadedAcl

) -> Acl

{ + (&acl).into() + } + } + + impl From<&LoadedAcl

> for Acl

{ + fn from(acl: &LoadedAcl

) -> Acl

{ let LoadedAcl(ents) = acl; Acl { ents: ents.into_iter().map( |LoadedAclEntry { pat, allow, deny, .. }| diff --git a/src/global.rs b/src/global.rs index 540b98f2..87bc5ae9 100644 --- a/src/global.rs +++ b/src/global.rs @@ -844,7 +844,7 @@ impl InstanceGuard<'_> { |(player, PlayerRecord { ipl, .. })| (player, ipl.clone()) ).collect(); - let acl = s.c.g.acl.into(); + let acl = (&s.c.g.acl).into(); let isa = InstanceSaveAccesses { ipieces, tokens_players, aplayers, acl }; @@ -943,7 +943,7 @@ impl InstanceGuard<'_> { let g = Instance { gs, iplayers, - acl: acl.into(), + acl: (&acl).into(), ipieces: PiecesLoaded(ipieces), name: name.clone(), clients : Default::default(),