trpl-zh-cn/listings/ch15-smart-pointers/listing-15-08/src/main.rs
2022-02-06 16:43:51 +08:00

12 lines
146 B
Rust
Executable File

// ANCHOR: here
struct MyBox<T>(T);
impl<T> MyBox<T> {
fn new(x: T) -> MyBox<T> {
MyBox(x)
}
}
// ANCHOR_END: here
fn main() {}