chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2be6bd4
)
authproofs: Make map generic rather than taking fn
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 30 May 2021 12:23:21 +0000
(13:23 +0100)
committer
Ian 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
patch
|
blob
|
history
diff --git
a/src/authproofs.rs
b/src/authproofs.rs
index c358731835766aa838e97996337010f386bf69a7..07dbf9865045e5203faa3472a2bd5b895602eaf7 100644
(file)
--- a/
src/authproofs.rs
+++ b/
src/authproofs.rs
@@
-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`