From 2ee549f84fb4fe6671eba1417d8c0b0b87552cb1 Mon Sep 17 00:00:00 2001 From: Brandon W Maister Date: Sun, 4 Mar 2018 09:16:29 -0500 Subject: [PATCH 1/2] Allow a clippy lint that depends on rust 1.17 --- src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 5ced85a..efc061f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -391,7 +391,10 @@ // backward compatibility, and this appeases clippy. If minimum rustc // becomes 1.17, should be able to remove this, those 'static lifetimes, // and use `static` in a lot of places `const` is used now. -#![cfg_attr(feature = "cargo-clippy", allow(const_static_lifetime))] +// +// Similarly, redundant_field_names lints on not using the +// field-init-shorthand, which was stabilized in rust 1.17. +#![cfg_attr(feature = "cargo-clippy", allow(const_static_lifetime, redundant_field_names))] extern crate time as oldtime; extern crate num; From 7f990144ccb81c93354c8112f566d4c065c6b49e Mon Sep 17 00:00:00 2001 From: Brandon W Maister Date: Sun, 4 Mar 2018 09:51:41 -0500 Subject: [PATCH 2/2] Allow a false-positive clippy lint rust-lang-nursery/rust-clippy#2475 , we'll revert this commit when that's fixed. --- src/format/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/format/mod.rs b/src/format/mod.rs index fc1e902..de13d2c 100644 --- a/src/format/mod.rs +++ b/src/format/mod.rs @@ -269,6 +269,8 @@ macro_rules! fix { ($x:ident) => (Item::Fixed(Fixed::$x)) } #[derive(Debug, Clone, PartialEq, Eq, Copy)] pub struct ParseError(ParseErrorKind); +// clippy false positive https://github.com/rust-lang-nursery/rust-clippy/issues/2475 +#[cfg_attr(feature = "cargo-clippy", allow(empty_line_after_outer_attr))] #[derive(Debug, Clone, PartialEq, Eq, Copy)] enum ParseErrorKind { /// Given field is out of permitted range.