Skip to content

Commit

Permalink
Update bitflags to v2.0.0
Browse files Browse the repository at this point in the history
Also fixes the MSRV to 1.63

Signed-off-by: John Nunley <dev@notgull.net>
  • Loading branch information
notgull committed Sep 16, 2023
1 parent b3b14e2 commit be3a111
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

strategy:
matrix:
rust: ["1.61.0"]
rust: ["1.63.0"]

steps:
- uses: actions/checkout@v3
Expand Down
12 changes: 9 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ readme = "README.md"
keywords = ["x11", "xim", "xcb", "xlib", "x11rb", "no-std"]
edition = "2018"
license = "MIT"
rust-version = "1.61"
rust-version = "1.63"

[features]
default = ["std"]
Expand Down
4 changes: 2 additions & 2 deletions xim-gen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl EnumFormat {

if self.bitflag {
writeln!(out, "bitflags::bitflags! {{")?;

writeln!(out, "#[derive(Clone, Copy, Debug, Eq, PartialEq)]")?;
writeln!(out, "pub struct {}: {} {{", name, self.repr)?;
for (name, variant) in variants.iter() {
writeln!(
Expand Down Expand Up @@ -406,7 +406,7 @@ pub fn write_format(
) -> Result<(), Box<dyn std::error::Error>> {
let format: XimFormat = serde_yaml::from_str(format_str)?;

let mut file = std::fs::File::create(out_path.as_ref())?;
let mut file = std::io::BufWriter::new(std::fs::File::create(out_path.as_ref())?);

file.write_all(include_bytes!("../res/snippet.rs"))?;
format.write(&mut file)?;
Expand Down
2 changes: 1 addition & 1 deletion xim-parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ std = []
bootstrap = ["xim-gen"]

[dependencies]
bitflags = { version = "1.3.2", default-features = false }
bitflags = { version = "2.4.0", default-features = false }

[dev-dependencies]
xim-ctext = { path = "../xim-ctext", version = "0.3.0" }
Expand Down
5 changes: 5 additions & 0 deletions xim-parser/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ impl XimWrite for ErrorCode {
}
}
bitflags::bitflags! {
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct ErrorFlag: u16 {
const INPUT_METHOD_ID_VALID = 1;
const INPUT_CONTEXT_ID_VALID = 2;
Expand Down Expand Up @@ -720,6 +721,7 @@ impl XimWrite for Feedback {
}
}
bitflags::bitflags! {
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct ForwardEventFlag: u16 {
const SYNCHRONOUS = 1;
const REQUEST_FILTERING = 2;
Expand Down Expand Up @@ -765,6 +767,7 @@ impl XimWrite for HotKeyState {
}
}
bitflags::bitflags! {
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct InputStyle: u32 {
const PREEDIT_AREA = 1;
const PREEDIT_CALLBACKS = 2;
Expand Down Expand Up @@ -792,6 +795,7 @@ impl XimWrite for InputStyle {
}
}
bitflags::bitflags! {
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct PreeditDrawStatus: u32 {
const NO_STRING = 1;
const NO_FEEDBACK = 2;
Expand All @@ -812,6 +816,7 @@ impl XimWrite for PreeditDrawStatus {
}
}
bitflags::bitflags! {
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct PreeditStateFlag: u32 {
const UNKNOWN = 0;
const ENABLE = 1;
Expand Down

0 comments on commit be3a111

Please sign in to comment.