mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 23:24:24 +00:00
Auto merge of #4284 - flip1995:rustfmt, r=phansch
Format code changelog: none
This commit is contained in:
commit
e9ff319f3e
2 changed files with 8 additions and 3 deletions
|
@ -63,6 +63,7 @@ impl<'a, 'tcx> DoubleComparisons {
|
|||
);
|
||||
}};
|
||||
}
|
||||
#[rustfmt::skip]
|
||||
match (op, lkind, rkind) {
|
||||
(BinOpKind::Or, BinOpKind::Eq, BinOpKind::Lt) | (BinOpKind::Or, BinOpKind::Lt, BinOpKind::Eq) => {
|
||||
lint_double_comparison!(<=)
|
||||
|
|
|
@ -2,13 +2,17 @@
|
|||
#![deny(rust_2018_idioms)]
|
||||
extern crate proc_macro;
|
||||
|
||||
use proc_macro::{TokenStream, quote};
|
||||
use proc_macro::{quote, TokenStream};
|
||||
|
||||
#[proc_macro_derive(ClippyMiniMacroTest)]
|
||||
pub fn mini_macro(_: TokenStream) -> TokenStream {
|
||||
quote!(
|
||||
#[allow(unused)] fn needless_take_by_value(s: String) { println!("{}", s.len()); }
|
||||
#[allow(unused)] fn needless_loop(items: &[u8]) {
|
||||
#[allow(unused)]
|
||||
fn needless_take_by_value(s: String) {
|
||||
println!("{}", s.len());
|
||||
}
|
||||
#[allow(unused)]
|
||||
fn needless_loop(items: &[u8]) {
|
||||
for i in 0..items.len() {
|
||||
println!("{}", items[i]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue