chiark / gitweb /
ToReculculate: Slightly improve docs and formatting of with
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 1 May 2022 12:02:31 +0000 (13:02 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 1 May 2022 12:03:02 +0000 (13:03 +0100)
This was a bit confusing at first.

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

index d47a41c92bbb9f2165d55c54111f2a9547030c3a..3509975d262f57ff7ad24f0d641d69fd981f7c01 100644 (file)
@@ -842,8 +842,9 @@ mod recompute {
   }
 
   impl ToRecalculate {
-    pub fn with<R, F: FnOnce(Self) -> (R, Implemented)>
-      (f: F) -> (R, UnpreparedUpdates)
+    /// F returning `Implemented` proves that it called `implement`
+    pub fn with<R, F>(f: F) -> (R, UnpreparedUpdates)
+    where F: FnOnce(Self) -> (R, Implemented)
     {
       let to_recalculate = ToRecalculate { outdated: default() };
       let (r, Implemented(uu)) = f(to_recalculate);