mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-16 17:58:14 +00:00
eb3970285b
In order to switch `clippy::uninlined_format_args` from pedantic to style, all existing tests must not raise a warning. I did not want to change the actual tests, so this is a relatively minor change that: * add `#![allow(clippy::uninlined_format_args)]` where needed * normalizes all allow/deny/warn attributes * all allow attributes are grouped together * sorted alphabetically * the `clippy::*` attributes are listed separate from the other ones. * deny and warn attributes are listed before the allowed ones changelog: none
76 lines
1.5 KiB
Rust
76 lines
1.5 KiB
Rust
// run-rustfix
|
|
#![warn(clippy::all, clippy::redundant_pattern_matching)]
|
|
#![allow(unused_must_use)]
|
|
#![allow(
|
|
clippy::match_like_matches_macro,
|
|
clippy::needless_bool,
|
|
clippy::uninlined_format_args
|
|
)]
|
|
|
|
use std::net::{
|
|
IpAddr::{self, V4, V6},
|
|
Ipv4Addr, Ipv6Addr,
|
|
};
|
|
|
|
fn main() {
|
|
let ipaddr: IpAddr = V4(Ipv4Addr::LOCALHOST);
|
|
if ipaddr.is_ipv4() {}
|
|
|
|
if V4(Ipv4Addr::LOCALHOST).is_ipv4() {}
|
|
|
|
if V6(Ipv6Addr::LOCALHOST).is_ipv6() {}
|
|
|
|
while V4(Ipv4Addr::LOCALHOST).is_ipv4() {}
|
|
|
|
while V6(Ipv6Addr::LOCALHOST).is_ipv6() {}
|
|
|
|
if V4(Ipv4Addr::LOCALHOST).is_ipv4() {}
|
|
|
|
if V6(Ipv6Addr::LOCALHOST).is_ipv6() {}
|
|
|
|
if let V4(ipaddr) = V4(Ipv4Addr::LOCALHOST) {
|
|
println!("{}", ipaddr);
|
|
}
|
|
|
|
V4(Ipv4Addr::LOCALHOST).is_ipv4();
|
|
|
|
V4(Ipv4Addr::LOCALHOST).is_ipv6();
|
|
|
|
V6(Ipv6Addr::LOCALHOST).is_ipv6();
|
|
|
|
V6(Ipv6Addr::LOCALHOST).is_ipv4();
|
|
|
|
let _ = if V4(Ipv4Addr::LOCALHOST).is_ipv4() {
|
|
true
|
|
} else {
|
|
false
|
|
};
|
|
|
|
ipaddr_const();
|
|
|
|
let _ = if gen_ipaddr().is_ipv4() {
|
|
1
|
|
} else if gen_ipaddr().is_ipv6() {
|
|
2
|
|
} else {
|
|
3
|
|
};
|
|
}
|
|
|
|
fn gen_ipaddr() -> IpAddr {
|
|
V4(Ipv4Addr::LOCALHOST)
|
|
}
|
|
|
|
const fn ipaddr_const() {
|
|
if V4(Ipv4Addr::LOCALHOST).is_ipv4() {}
|
|
|
|
if V6(Ipv6Addr::LOCALHOST).is_ipv6() {}
|
|
|
|
while V4(Ipv4Addr::LOCALHOST).is_ipv4() {}
|
|
|
|
while V6(Ipv6Addr::LOCALHOST).is_ipv6() {}
|
|
|
|
V4(Ipv4Addr::LOCALHOST).is_ipv4();
|
|
|
|
V6(Ipv6Addr::LOCALHOST).is_ipv6();
|
|
}
|