Use bitflags! consistently. (#680)

This removes an `extern crate` and a `use` so that we always
call it via `bitflags::bitflags!` everywhere.
This commit is contained in:
Bruce Mitchener
2024-07-12 22:00:24 +07:00
committed by GitHub
parent 01dd200152
commit 23c0c05a5b
3 changed files with 3 additions and 8 deletions

View File

@@ -75,9 +75,7 @@ impl Default for InteractionGroups {
} }
} }
use bitflags::bitflags; bitflags::bitflags! {
bitflags! {
/// A bit mask identifying groups for interaction. /// A bit mask identifying groups for interaction.
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)] #[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]

View File

@@ -3,9 +3,6 @@
extern crate nalgebra as na; extern crate nalgebra as na;
#[macro_use]
extern crate bitflags;
#[cfg(feature = "log")] #[cfg(feature = "log")]
#[macro_use] #[macro_use]
extern crate log; extern crate log;

View File

@@ -74,7 +74,7 @@ fn usage(exe_name: &str) {
info!(" --pause - do not start the simulation right away."); info!(" --pause - do not start the simulation right away.");
} }
bitflags! { bitflags::bitflags! {
#[derive(Copy, Clone, PartialEq, Eq, Debug, Default)] #[derive(Copy, Clone, PartialEq, Eq, Debug, Default)]
pub struct TestbedStateFlags: u32 { pub struct TestbedStateFlags: u32 {
const NONE = 0; const NONE = 0;
@@ -91,7 +91,7 @@ bitflags! {
} }
} }
bitflags! { bitflags::bitflags! {
#[derive(Copy, Clone, PartialEq, Eq, Debug)] #[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct TestbedActionFlags: u32 { pub struct TestbedActionFlags: u32 {
const RESET_WORLD_GRAPHICS = 1 << 0; const RESET_WORLD_GRAPHICS = 1 << 0;