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

Make some enums non_exhaustive #364

Merged
merged 1 commit into from
Apr 13, 2020
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: 4 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ pub enum HistoryDuplicates {
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum CompletionType {
/// Complete the next full match (like in Vim by default)
Circular,
Expand All @@ -199,13 +200,15 @@ pub enum CompletionType {

/// Style of editing / Standard keymaps
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum EditMode {
Emacs,
Vi,
}

/// Colorization mode
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum ColorMode {
Enabled,
Forced,
Expand All @@ -215,6 +218,7 @@ pub enum ColorMode {
/// Should the editor use stdout or stderr
// TODO console term::TermTarget
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum OutputStreamType {
Stderr,
Stdout,
Expand Down
1 change: 1 addition & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use std::io;
// #[non_exhaustive]
#[allow(clippy::module_name_repetitions)]
#[derive(Debug)]
#[non_exhaustive]
pub enum ReadlineError {
/// I/O Error
Io(io::Error),
Expand Down
3 changes: 2 additions & 1 deletion src/keymap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ use crate::tty::{RawReader, Term, Terminal};
pub type RepeatCount = usize;

/// Commands
// #[non_exhaustive]
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
pub enum Cmd {
/// abort
Abort, // Miscellaneous Command
Expand Down Expand Up @@ -233,6 +233,7 @@ impl CharSearch {

/// Where to move
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
pub enum Movement {
WholeLine, // not really a movement
/// beginning-of-line
Expand Down
2 changes: 1 addition & 1 deletion src/keys.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Key constants

// #[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum KeyPress {
UnknownEscSeq,
Backspace, // Ctrl('H')
Expand Down