trpl-zh-cn/listings/ch13-functional-features/listing-13-09/src/main.rs

12 lines
144 B
Rust
Raw Normal View History

2022-02-06 16:43:51 +08:00
// ANCHOR: here
struct Cacher<T>
where
T: Fn(u32) -> u32,
{
calculation: T,
value: Option<u32>,
}
// ANCHOR_END: here
fn main() {}