Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Oct 16, 2023
1 parent 4a54326 commit 3d66bda
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -14,7 +14,7 @@ readme = "README.md"
repository = "https://github.com/veeso/tui-realm"

[dependencies]
bitflags = "=1.3"
bitflags = "2.4"
crossterm = { version = "0.27", optional = true }
lazy-regex = "3"
serde = { version = "^1", features = ["derive"], optional = true }
Expand Down
4 changes: 2 additions & 2 deletions src/adapter/crossterm/event.rs
Expand Up @@ -71,7 +71,7 @@ impl From<XtermKeyCode> for Key {

impl From<XtermKeyModifiers> for KeyModifiers {
fn from(k: XtermKeyModifiers) -> Self {
let mut km = KeyModifiers::empty();
let mut km = KeyModifiers::NONE;
if k.intersects(XtermKeyModifiers::SHIFT) {
km.insert(KeyModifiers::SHIFT);
}
Expand Down Expand Up @@ -235,7 +235,7 @@ mod test {
kind: XtermMouseEventKind::Moved,
column: 0,
row: 0,
modifiers: XtermKeyModifiers::empty(),
modifiers: XtermKeyModifiers::NONE,
})),
Event::None
);
Expand Down
5 changes: 3 additions & 2 deletions src/core/event.rs
Expand Up @@ -149,6 +149,7 @@ bitflags! {
///
/// Defines special key states, such as shift, control, alt...
#[cfg_attr(feature = "serialize", derive(Deserialize, Serialize), serde(tag = "type"))]
#[derive(Clone, Copy, Hash, Eq, PartialEq, Debug, PartialOrd, Ord)]
pub struct KeyModifiers: u8 {
const NONE = 0b0000_0000;
const SHIFT = 0b0000_0001;
Expand All @@ -165,7 +166,7 @@ impl KeyEvent {

impl From<Key> for KeyEvent {
fn from(k: Key) -> Self {
Self::new(k, KeyModifiers::empty())
Self::new(k, KeyModifiers::NONE)
}
}

Expand Down Expand Up @@ -224,7 +225,7 @@ mod test {
fn key_event_from_key() {
let k = KeyEvent::from(Key::Up);
assert_eq!(k.code, Key::Up);
assert_eq!(k.modifiers, KeyModifiers::empty());
assert_eq!(k.modifiers, KeyModifiers::NONE);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/core/props/layout.rs
Expand Up @@ -61,7 +61,7 @@ impl Layout {
/// Split an `Area` into chunks using the current layout configuration
pub fn chunks(&self, area: Rect) -> Vec<Rect> {
TuiLayout::default()
.direction(self.direction.clone())
.direction(self.direction)
.horizontal_margin(self.margin.horizontal)
.vertical_margin(self.margin.vertical)
.constraints::<&[Constraint]>(self.constraints.as_ref())
Expand Down

0 comments on commit 3d66bda

Please sign in to comment.