blob: 4f9dd19abbd831854bfc51ce06d606d7ad07c447 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
impl methods for uint {
fn double() -> uint { self }
}
impl methods for @uint {
fn double() -> uint { *self * 2u }
}
fn main() {
let x = @3u;
assert x.double() == 6u;
}
|