diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2015-03-30 09:40:52 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2015-04-01 11:23:45 -0400 |
| commit | c35c46821a69af14e6b38e0238f70e22433a3e8e (patch) | |
| tree | 7ac8c7a22194415f47c035622f5df59517f8b5bd /src/doc/reference.md | |
| parent | 49b76a087bbbca3771c8b98125ecb59f7bfe80e6 (diff) | |
| download | rust-c35c46821a69af14e6b38e0238f70e22433a3e8e.tar.gz rust-c35c46821a69af14e6b38e0238f70e22433a3e8e.zip | |
Fallout in public-facing and semi-public-facing libs
Diffstat (limited to 'src/doc/reference.md')
| -rw-r--r-- | src/doc/reference.md | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md index b3d5ad3b55d..cc90a69fd2a 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -1648,7 +1648,7 @@ specific type. Implementations are defined with the keyword `impl`. ``` -# #[derive(Copy)] +# #[derive(Copy, Clone)] # struct Point {x: f64, y: f64}; # type Surface = i32; # struct BoundingBox {x: f64, y: f64, width: f64, height: f64}; @@ -1661,6 +1661,10 @@ struct Circle { impl Copy for Circle {} +impl Clone for Circle { + fn clone(&self) -> Circle { *self } +} + impl Shape for Circle { fn draw(&self, s: Surface) { do_draw_circle(s, *self); } fn bounding_box(&self) -> BoundingBox { |
