// 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 {
}
}
- // 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);
}