2015-08-11 18:53:50 +00:00
|
|
|
#![feature(plugin)]
|
|
|
|
#![plugin(clippy)]
|
|
|
|
|
|
|
|
#[deny(option_unwrap_used, result_unwrap_used)]
|
2015-08-12 15:02:49 +00:00
|
|
|
#[deny(str_to_string, string_to_string)]
|
2015-08-11 18:53:50 +00:00
|
|
|
fn main() {
|
|
|
|
let opt = Some(0);
|
2015-08-13 06:12:07 +00:00
|
|
|
let _ = opt.unwrap(); //~ERROR used unwrap() on an Option
|
2015-08-11 18:53:50 +00:00
|
|
|
|
|
|
|
let res: Result<i32, ()> = Ok(0);
|
2015-08-13 06:12:07 +00:00
|
|
|
let _ = res.unwrap(); //~ERROR used unwrap() on a Result
|
2015-08-12 15:02:49 +00:00
|
|
|
|
2015-08-13 06:12:07 +00:00
|
|
|
let string = "str".to_string(); //~ERROR `str.to_owned()` is faster
|
|
|
|
let _again = string.to_string(); //~ERROR `String.to_string()` is a no-op
|
2015-08-11 18:53:50 +00:00
|
|
|
}
|