trpl-zh-cn/listings/ch13-functional-features/listing-13-09/src/main.rs
2022-02-06 16:43:51 +08:00

12 lines
144 B
Rust
Executable File

// ANCHOR: here
struct Cacher<T>
where
T: Fn(u32) -> u32,
{
calculation: T,
value: Option<u32>,
}
// ANCHOR_END: here
fn main() {}