Mercurial > lbo > hg > memoize
view examples/empty.rs @ 92:813907a7c64f
Remove `Cargo.lock` from directory
author | blyxyas <blyxyas@gmail.com> |
---|---|
date | Fri, 13 Jan 2023 11:46:20 +0100 |
parents | fbf408e00f17 |
children |
line wrap: on
line source
//! Reproduces (verifies) issue #17: Panics when used on fn without args. use memoize::memoize; #[memoize] fn hello() -> bool { println!("hello!"); true } fn main() { // `hello` is only called once here. assert!(hello()); assert!(hello()); memoized_flush_hello(); // and again here. assert!(hello()); }