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

Fix clippy warnings #631

Merged
merged 1 commit into from
May 29, 2022
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
4 changes: 2 additions & 2 deletions src/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ cfg_if::cfg_if! {
}

/// Kind of quote.
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum Quote {
/// Double quote: `"`
Double,
Expand Down Expand Up @@ -473,7 +473,7 @@ pub fn longest_common_prefix<C: Candidate>(candidates: &[C]) -> Option<&str> {
Some(&candidate[0..longest_common_prefix])
}

#[derive(PartialEq)]
#[derive(Eq, PartialEq)]
enum ScanMode {
DoubleQuote,
Escape,
Expand Down
14 changes: 7 additions & 7 deletions src/keymap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{Event, EventContext, EventHandler};
pub type RepeatCount = usize;

/// Commands
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum Cmd {
/// abort
Expand Down Expand Up @@ -215,7 +215,7 @@ const fn repeat_count(previous: RepeatCount, new: Option<RepeatCount>) -> Repeat
}

/// Different word definitions
#[derive(Debug, Clone, PartialEq, Copy)]
#[derive(Debug, Clone, Eq, PartialEq, Copy)]
pub enum Word {
/// non-blanks characters
Big,
Expand All @@ -226,7 +226,7 @@ pub enum Word {
}

/// Where to move with respect to word boundary
#[derive(Debug, Clone, PartialEq, Copy)]
#[derive(Debug, Clone, Eq, PartialEq, Copy)]
pub enum At {
/// Start of word.
Start,
Expand All @@ -237,7 +237,7 @@ pub enum At {
}

/// Where to paste (relative to cursor position)
#[derive(Debug, Clone, PartialEq, Copy)]
#[derive(Debug, Clone, Eq, PartialEq, Copy)]
pub enum Anchor {
/// After cursor
After,
Expand All @@ -246,7 +246,7 @@ pub enum Anchor {
}

/// character search
#[derive(Debug, Clone, PartialEq, Copy)]
#[derive(Debug, Clone, Eq, PartialEq, Copy)]
pub enum CharSearch {
/// Forward search
Forward(char),
Expand All @@ -270,7 +270,7 @@ impl CharSearch {
}

/// Where to move
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum Movement {
/// Whole current line (not really a movement but a range)
Expand Down Expand Up @@ -332,7 +332,7 @@ impl Movement {
}

/// Vi input modes
#[derive(Clone, Copy, PartialEq)]
#[derive(Clone, Copy, Eq, PartialEq)]
pub enum InputMode {
/// Vi Command/Alternate
Command,
Expand Down
2 changes: 1 addition & 1 deletion src/tty/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ type ConsoleKeyMap = ();
#[cfg(not(test))]
pub type KeyMap = ConsoleKeyMap;

#[must_use = "You must restore default mode (disable_raw_mode)"]
#[cfg(not(test))]
pub type Mode = ConsoleMode;

#[must_use = "You must restore default mode (disable_raw_mode)"]
#[derive(Clone, Debug)]
pub struct ConsoleMode {
original_conin_mode: DWORD,
Expand Down