]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/nested-class.rs
cleanup: s/impl Copy/#[derive(Copy)]/g
[rust.git] / src / test / run-pass / nested-class.rs
index 2f2930dbab7c7f3e8eff839ce4203b78137de864..19eba0808c88237cdc4f5b79430a57ad24dfd238 100644 (file)
@@ -9,14 +9,13 @@
 // except according to those terms.
 
 pub fn main() {
-  
-  struct b {
-    i: int,
-  }
+    struct b {
+        i: int,
+    }
 
-  pub impl b {
-    fn do_stuff() -> int { return 37; }
-  }
+    impl b {
+        fn do_stuff(&self) -> int { return 37; }
+    }
 
     fn b(i:int) -> b {
         b {
@@ -24,10 +23,9 @@ fn b(i:int) -> b {
         }
     }
 
-  //  fn b(x:int) -> int { fail!(); }
+    //  fn b(x:int) -> int { panic!(); }
 
-  let z = b(42);
-  assert(z.i == 42);
-  assert(z.do_stuff() == 37);
-  
+    let z = b(42);
+    assert_eq!(z.i, 42);
+    assert_eq!(z.do_stuff(), 37);
 }