Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bitflags requirement from 1.3 to 2.0 #688

Merged
merged 2 commits into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ maintenance = { status = "actively-developed" }
members = ["rustyline-derive"]

[dependencies]
bitflags = "1.3"
bitflags = "2.0"
cfg-if = "1.0"
# For file completion
# https://rustsec.org/advisories/RUSTSEC-2020-0053.html
Expand Down
9 changes: 5 additions & 4 deletions src/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ pub enum KeyCode {

bitflags::bitflags! {
/// The set of modifier keys that were triggered along with a key press.
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub struct Modifiers: u8 {
/// Control modifier
const CTRL = 1<<3;
Expand All @@ -181,13 +182,13 @@ bitflags::bitflags! {
/// No modifier
const NONE = 0;
/// Ctrl + Shift
const CTRL_SHIFT = Self::CTRL.bits | Self::SHIFT.bits;
const CTRL_SHIFT = Self::CTRL.bits() | Self::SHIFT.bits();
/// Alt + Shift
const ALT_SHIFT = Self::ALT.bits | Self::SHIFT.bits;
const ALT_SHIFT = Self::ALT.bits() | Self::SHIFT.bits();
/// Ctrl + Alt
const CTRL_ALT = Self::CTRL.bits | Self::ALT.bits;
const CTRL_ALT = Self::CTRL.bits() | Self::ALT.bits();
/// Ctrl + Alt + Shift
const CTRL_ALT_SHIFT = Self::CTRL.bits | Self::ALT.bits | Self::SHIFT.bits;
const CTRL_ALT_SHIFT = Self::CTRL.bits() | Self::ALT.bits() | Self::SHIFT.bits();
}
}

Expand Down