From: Ian Jackson Date: Sun, 30 May 2021 12:23:21 +0000 (+0100) Subject: authproofs: Make map generic rather than taking fn X-Git-Tag: otter-0.7.0~218 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=3034318ce7e88342578f7866f0c1ef9d70e006ac;p=otter.git authproofs: Make map generic rather than taking fn This will lets us feed context into the mapper. Signed-off-by: Ian Jackson --- diff --git a/src/authproofs.rs b/src/authproofs.rs index c3587318..07dbf986 100644 --- a/src/authproofs.rs +++ b/src/authproofs.rs @@ -35,7 +35,7 @@ impl Authorisation { pub const fn authorised(_v: &T) -> Authorisation { Authorisation(PhantomData) } - pub fn map(self, _f: fn(&T) -> &U) -> Authorisation { + pub fn map(self, _f: F) -> Authorisation where F: Fn(&T) -> &U { self.therefore_ok() } /// Minor proof obligation: in this case, authorised access to `T`