Skip to content

Commit 2e5bc8b

Browse files
committed
Update to bitflags 2.3.1.
This is a new major version and requires some code changes.
1 parent ee2e1de commit 2e5bc8b

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ targets = [
2828

2929
[dependencies]
3030
libc = { version = "0.2.141", features = ["extra_traits"] }
31-
bitflags = "1.1"
31+
bitflags = "2.3.1"
3232
cfg-if = "1.0"
3333
pin-utils = { version = "0.1.0", optional = true }
3434
static_assertions = "1"

src/macros.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ macro_rules! libc_bitflags {
6363
}
6464
) => {
6565
::bitflags::bitflags! {
66+
#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
6667
$(#[$outer])*
6768
pub struct $BitFlags: $T {
6869
$(

src/sys/termios.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ impl Termios {
309309
let termios = *self.inner.borrow_mut();
310310
self.input_flags = InputFlags::from_bits_truncate(termios.c_iflag);
311311
self.output_flags = OutputFlags::from_bits_truncate(termios.c_oflag);
312-
self.control_flags = ControlFlags::from_bits_truncate(termios.c_cflag);
312+
self.control_flags = ControlFlags::from_bits_retain(termios.c_cflag);
313313
self.local_flags = LocalFlags::from_bits_truncate(termios.c_lflag);
314314
self.control_chars = termios.c_cc;
315315
#[cfg(any(

src/sys/time.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ pub(crate) mod timer {
9191
#[cfg(any(target_os = "android", target_os = "linux"))]
9292
bitflags! {
9393
/// Flags that are used for arming the timer.
94+
#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
9495
pub struct TimerSetTimeFlags: libc::c_int {
9596
const TFD_TIMER_ABSTIME = libc::TFD_TIMER_ABSTIME;
9697
const TFD_TIMER_CANCEL_ON_SET = libc::TFD_TIMER_CANCEL_ON_SET;
@@ -104,6 +105,7 @@ pub(crate) mod timer {
104105
))]
105106
bitflags! {
106107
/// Flags that are used for arming the timer.
108+
#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
107109
pub struct TimerSetTimeFlags: libc::c_int {
108110
const TFD_TIMER_ABSTIME = libc::TIMER_ABSTIME;
109111
}

0 commit comments

Comments
 (0)