use std::ops::{Deref, RangeFrom};
+fn approx_const() {
+ let log2_10 = 3.321928094887362;
+ let log10_2 = 0.301029995663981;
+}
+
fn cloned_instead_of_copied() {
let _ = [1].iter().cloned();
}
}
pub fn use_self() {
- struct Foo {}
+ struct Foo;
impl Foo {
fn new() -> Foo {
if let TS(0, x) | TS(1, x) = TS(0, 0) {}
}
+#[cfg_attr(rustfmt, rustfmt_skip)]
+fn deprecated_cfg_attr() {}
+
+#[warn(clippy::cast_lossless)]
+fn int_from_bool() -> u8 {
+ true as u8
+}
+
+fn err_expect() {
+ let x: Result<u32, &str> = Ok(10);
+ x.err().expect("Testing expect_err");
+}
+
+fn cast_abs_to_unsigned() {
+ let x: i32 = 10;
+ assert_eq!(10u32, x.abs() as u32);
+}
+
fn main() {
filter_map_next();
checked_conversion();
map_unwrap_or();
missing_const_for_fn();
unnest_or_patterns();
+ int_from_bool();
+ err_expect();
+ cast_abs_to_unsigned();
}
-mod meets_msrv {
+mod just_under_msrv {
#![feature(custom_inner_attributes)]
- #![clippy::msrv = "1.45.0"]
+ #![clippy::msrv = "1.44.0"]
fn main() {
let s = "hello, world!";
}
}
-mod just_under_msrv {
+mod meets_msrv {
#![feature(custom_inner_attributes)]
- #![clippy::msrv = "1.46.0"]
+ #![clippy::msrv = "1.45.0"]
fn main() {
let s = "hello, world!";
mod just_above_msrv {
#![feature(custom_inner_attributes)]
- #![clippy::msrv = "1.44.0"]
+ #![clippy::msrv = "1.46.0"]
fn main() {
let s = "hello, world!";