chiark / gitweb /
authproofs: Make map generic rather than taking fn
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 30 May 2021 12:23:21 +0000 (13:23 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 30 May 2021 12:44:07 +0000 (13:44 +0100)
This will lets us feed context into the mapper.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/authproofs.rs

index c358731835766aa838e97996337010f386bf69a7..07dbf9865045e5203faa3472a2bd5b895602eaf7 100644 (file)
@@ -35,7 +35,7 @@ impl<T> Authorisation<T> {
   pub const fn authorised(_v: &T) -> Authorisation<T> {
     Authorisation(PhantomData)
   }
-  pub fn map<U>(self, _f: fn(&T) -> &U) -> Authorisation<U> {
+  pub fn map<U,F>(self, _f: F) -> Authorisation<U> where F: Fn(&T) -> &U {
     self.therefore_ok()
   }
   /// Minor proof obligation: in this case, authorised access to `T`