mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
16 lines
180 B
Rust
16 lines
180 B
Rust
// run-pass
|
|
|
|
trait Fooable {
|
|
fn yes(self);
|
|
}
|
|
|
|
impl Fooable for usize {
|
|
fn yes(self) {
|
|
for _ in 0..self { println!("yes"); }
|
|
}
|
|
}
|
|
|
|
pub fn main() {
|
|
2.yes();
|
|
}
|