]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/max-min-classes.rs
cleanup: s/impl Copy/#[derive(Copy)]/g
[rust.git] / src / test / run-pass / max-min-classes.rs
index 56c16d928741d5e61b6113882220bb6d7e03c77a..e3c375f8b0fdea321aa5019b6ae821bb6cf367fc 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 trait Product {
-    fn product() -> int;
+    fn product(&self) -> int;
 }
 
 struct Foo {
@@ -17,14 +17,14 @@ struct Foo {
     y: int,
 }
 
-pub impl Foo {
-    fn sum() -> int {
+impl Foo {
+    pub fn sum(&self) -> int {
         self.x + self.y
     }
 }
 
 impl Product for Foo {
-    fn product() -> int {
+    fn product(&self) -> int {
         self.x * self.y
     }
 }
@@ -35,6 +35,5 @@ fn Foo(x: int, y: int) -> Foo {
 
 pub fn main() {
     let foo = Foo(3, 20);
-    io::println(fmt!("%d %d", foo.sum(), foo.product()));
+    println!("{} {}", foo.sum(), foo.product());
 }
-