]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/private-method.rs
Remove struct ctors
[rust.git] / src / test / run-pass / private-method.rs
1 struct cat {
2   priv {
3     let mut meows : uint;
4       fn nap() { for uint::range(1u, 10u) |_i| { }}
5   }
6
7   let how_hungry : int;
8
9   fn play() {
10     self.meows += 1u;
11     self.nap();
12   }
13 }
14
15 fn cat(in_x : uint, in_y : int) -> cat {
16     cat {
17         meows: in_x,
18         how_hungry: in_y
19     }
20 }
21
22 fn main() {
23   let nyan : cat = cat(52u, 99);
24   nyan.play();
25 }