diff options
Diffstat (limited to 'src/doc/book/listings/ch15-smart-pointers/listing-15-08/src/main.rs')
-rw-r--r-- | src/doc/book/listings/ch15-smart-pointers/listing-15-08/src/main.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/doc/book/listings/ch15-smart-pointers/listing-15-08/src/main.rs b/src/doc/book/listings/ch15-smart-pointers/listing-15-08/src/main.rs new file mode 100644 index 000000000..f48594673 --- /dev/null +++ b/src/doc/book/listings/ch15-smart-pointers/listing-15-08/src/main.rs @@ -0,0 +1,11 @@ +// ANCHOR: here +struct MyBox<T>(T); + +impl<T> MyBox<T> { + fn new(x: T) -> MyBox<T> { + MyBox(x) + } +} +// ANCHOR_END: here + +fn main() {} |