fparkan/vendor/bitflags-1.3.2/tests/compile-pass/impls/convert.rs

18 lines
219 B
Rust
Raw Normal View History

use bitflags::bitflags;
bitflags! {
struct Flags: u32 {
const A = 0b00000001;
}
}
impl From<u32> for Flags {
fn from(v: u32) -> Flags {
Flags::from_bits_truncate(v)
}
}
fn main() {
}