Skip to content

Commit 74c3fff

Browse files
committed
Merge branch 'enabled' of github.com:Dherse/comemo into enabled
2 parents a075754 + 927b373 commit 74c3fff

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

macros/src/lib.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,19 @@ use syn::{parse_quote, Error, Result};
7777
/// }
7878
/// ```
7979
///
80-
/// # Disabling memoization
81-
/// If you want to disable memoization for a function, you can use the `enabled`
82-
/// attribute to conditionally enable or disable memoization. This is useful for
83-
/// situations where small calls are more expensive than recomputing the result.
84-
/// This allows you to bypass hashing and caching while still dealing with the
85-
/// same function signature. And allows saving memory and time.
86-
///
87-
/// By default, all functions are memoized. To disable memoization, you must
88-
/// specify an `enabled = <expr>` attribute. The expression must evaluate to a
89-
/// boolean value. If the expression is `false`, the function will be executed
90-
/// without hashing and caching.
80+
/// # Disabling memoization conditionally
81+
/// If you want to enable or disable memoization for a function conditionally,
82+
/// you can use the `enabled` attribute. This is useful for cheap function calls
83+
/// where dealing with the caching is more expensive than recomputing the
84+
/// result. This allows you to bypass hashing and constraint validation while
85+
/// still dealing with the same function signature. And allows saving memory and
86+
/// time.
87+
///
88+
/// By default, all functions are unconditionally memoized. To disable
89+
/// memoization conditionally, you must specify an `enabled = <expr>` attribute.
90+
/// The expression can use the parameters and must evaluate to a boolean value.
91+
/// If the expression is `false`, the function will be executed without hashing
92+
/// and caching.
9193
///
9294
/// ## Example
9395
/// ```

0 commit comments

Comments
 (0)