rust-clippy/examples/toplevel_ref_arg.rs
Manish Goregaokar 426a3ee1e7 Rustup
2015-03-02 16:13:44 +05:30

13 lines
170 B
Rust

#![feature(plugin)]
#![plugin(clippy)]
fn the_answer(ref mut x: u8) {
*x = 42;
}
fn main() {
let mut x = 0;
the_answer(x);
println!("The answer is {}.", x);
}