Skip to content

Commit

Permalink
Merge pull request #302 from KodrAus/fix/clippy-lints
Browse files Browse the repository at this point in the history
Fix up some clippy lints
  • Loading branch information
KodrAus committed Feb 19, 2023
2 parents 2206e5e + 9499b9e commit 2cf086c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
26 changes: 11 additions & 15 deletions src/lib.rs
Expand Up @@ -433,14 +433,12 @@ The macros are split into 3 modules:
/// }
/// }
///
/// fn main() {
/// let e1 = Flags::A | Flags::C;
/// let e2 = Flags::B | Flags::C;
/// assert_eq!((e1 | e2), Flags::ABC); // union
/// assert_eq!((e1 & e2), Flags::C); // intersection
/// assert_eq!((e1 - e2), Flags::A); // set difference
/// assert_eq!(!e2, Flags::A); // set complement
/// }
/// let e1 = Flags::A | Flags::C;
/// let e2 = Flags::B | Flags::C;
/// assert_eq!((e1 | e2), Flags::ABC); // union
/// assert_eq!((e1 & e2), Flags::C); // intersection
/// assert_eq!((e1 - e2), Flags::A); // set difference
/// assert_eq!(!e2, Flags::A); // set complement
/// ```
///
/// The generated `struct`s can also be extended with type and trait
Expand All @@ -465,15 +463,13 @@ The macros are split into 3 modules:
/// }
/// }
///
/// fn main() {
/// let mut flags = Flags::A | Flags::B;
/// let mut flags = Flags::A | Flags::B;
///
/// flags.clear();
/// assert!(flags.is_empty());
/// flags.clear();
/// assert!(flags.is_empty());
///
/// assert_eq!(format!("{:?}", Flags::A | Flags::B), "Flags(A | B)");
/// assert_eq!(format!("{:?}", Flags::B), "Flags(B)");
/// }
/// assert_eq!(format!("{:?}", Flags::A | Flags::B), "Flags(A | B)");
/// assert_eq!(format!("{:?}", Flags::B), "Flags(B)");
/// ```
#[macro_export(local_inner_macros)]
macro_rules! bitflags {
Expand Down
3 changes: 3 additions & 0 deletions src/parser.rs
Expand Up @@ -14,13 +14,16 @@
//! A | B | 0x0c
//! ```

#![allow(clippy::let_unit_value)]

use core::fmt;

/// An error encountered while parsing flags from text.
#[derive(Debug)]
pub struct ParseError(ParseErrorKind);

#[derive(Debug)]
#[allow(clippy::enum_variant_names)]
enum ParseErrorKind {
EmptyFlag,
InvalidNamedFlag {
Expand Down

0 comments on commit 2cf086c

Please sign in to comment.