Skip to content

Commit c3a5a7d

Browse files
committed
Updated to latest deps and fixed bitflags example buildbreak
1 parent 5b050b3 commit c3a5a7d

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ publish = false
88
build = "build.rs"
99

1010
[dependencies]
11-
base64 = "0.6"
12-
bitflags = "0.9"
11+
base64 = "0.7"
12+
bitflags = "1.0"
1313
byteorder = "1.0"
1414
chrono = "0.4"
1515
clap = "2.26"
@@ -18,7 +18,7 @@ csv = "1.0.0-beta.4"
1818
data-encoding = "2.0.0-rc.1"
1919
env_logger = "0.4"
2020
error-chain = "0.11"
21-
flate2 = "0.2.19"
21+
flate2 = "0.2"
2222
glob = "0.2"
2323
image = "0.15"
2424
lazy_static = "0.2"

src/basics.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -760,9 +760,9 @@ bitflags! {
760760
const FLAG_A = 0b00000001;
761761
const FLAG_B = 0b00000010;
762762
const FLAG_C = 0b00000100;
763-
const FLAG_ABC = FLAG_A.bits
764-
| FLAG_B.bits
765-
| FLAG_C.bits;
763+
const FLAG_ABC = Self::FLAG_A.bits
764+
| Self::FLAG_B.bits
765+
| Self::FLAG_C.bits;
766766
}
767767
}
768768

@@ -781,19 +781,19 @@ impl fmt::Display for MyFlags {
781781
}
782782

783783
fn main() {
784-
let e1 = FLAG_A | FLAG_C;
785-
let e2 = FLAG_B | FLAG_C;
786-
assert_eq!((e1 | e2), FLAG_ABC); // union
787-
assert_eq!((e1 & e2), FLAG_C); // intersection
788-
assert_eq!((e1 - e2), FLAG_A); // set difference
789-
assert_eq!(!e2, FLAG_A); // set complement
790-
791-
let mut flags = FLAG_ABC;
784+
let e1 = MyFlags::FLAG_A | MyFlags::FLAG_C;
785+
let e2 = MyFlags::FLAG_B | MyFlags::FLAG_C;
786+
assert_eq!((e1 | e2), MyFlags::FLAG_ABC); // union
787+
assert_eq!((e1 & e2), MyFlags::FLAG_C); // intersection
788+
assert_eq!((e1 - e2), MyFlags::FLAG_A); // set difference
789+
assert_eq!(!e2, MyFlags::FLAG_A); // set complement
790+
791+
let mut flags = MyFlags::FLAG_ABC;
792792
assert_eq!(format!("{}", flags), "00000000000000000000000000000111");
793793
assert_eq!(format!("{}", flags.clear()), "00000000000000000000000000000000");
794794
// Debug trait is automatically derived for the MyFlags through `bitflags!`
795-
assert_eq!(format!("{:?}", FLAG_B), "FLAG_B");
796-
assert_eq!(format!("{:?}", FLAG_A | FLAG_B), "FLAG_A | FLAG_B");
795+
assert_eq!(format!("{:?}", MyFlags::FLAG_B), "FLAG_B");
796+
assert_eq!(format!("{:?}", MyFlags::FLAG_A | MyFlags::FLAG_B), "FLAG_A | FLAG_B");
797797
}
798798
```
799799

0 commit comments

Comments
 (0)