summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-06-27 19:46:46 -0400
committerDan Davison <dandavison7@gmail.com>2020-06-27 19:51:42 -0400
commit817446b403b147a9486d0d6f6e7b96ab31d9c226 (patch)
treefcc4142fd7847f0d7741b7709d36fc64e34c3799
parentc55bec8f0d75183bebc3b8bb9c51d5728d2f7d52 (diff)
Rename: unreachable -> delta_unreachable
-rw-r--r--src/config.rs4
-rw-r--r--src/option_value.rs12
-rw-r--r--src/parse_style.rs4
3 files changed, 10 insertions, 10 deletions
diff --git a/src/config.rs b/src/config.rs
index 03e0d68e..d246313a 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -76,7 +76,7 @@ impl Config {
State::CommitMeta => &self.commit_style,
State::FileMeta => &self.file_style,
State::HunkHeader => &self.hunk_header_style,
- _ => unreachable("Unreachable code reached in get_style."),
+ _ => delta_unreachable("Unreachable code reached in get_style."),
}
}
}
@@ -473,7 +473,7 @@ pub fn user_supplied_option(option: &str, arg_matches: &clap::ArgMatches) -> boo
arg_matches.occurrences_of(option) > 0
}
-pub fn unreachable(message: &str) -> ! {
+pub fn delta_unreachable(message: &str) -> ! {
eprintln!(
"{} This should not be possible. \
Please report the bug at https://github.com/dandavison/delta/issues.",
diff --git a/src/option_value.rs b/src/option_value.rs
index 73bdff7c..cbe5b383 100644
--- a/src/option_value.rs
+++ b/src/option_value.rs
@@ -1,4 +1,4 @@
-use crate::config::unreachable;
+use crate::config::delta_unreachable;
/// A value associated with a Delta command-line option name.
pub enum OptionValue {
@@ -25,7 +25,7 @@ impl From<OptionValue> for bool {
fn from(value: OptionValue) -> Self {
match value {
OptionValue::Boolean(value) => value,
- _ => unreachable("Error converting OptionValue to bool."),
+ _ => delta_unreachable("Error converting OptionValue to bool."),
}
}
}
@@ -40,7 +40,7 @@ impl From<OptionValue> for f64 {
fn from(value: OptionValue) -> Self {
match value {
OptionValue::Float(value) => value,
- _ => unreachable("Error converting OptionValue to f64."),
+ _ => delta_unreachable("Error converting OptionValue to f64."),
}
}
}
@@ -55,7 +55,7 @@ impl From<OptionValue> for Option<String> {
fn from(value: OptionValue) -> Self {
match value {
OptionValue::OptionString(value) => value,
- _ => unreachable("Error converting OptionValue to Option<String>."),
+ _ => delta_unreachable("Error converting OptionValue to Option<String>."),
}
}
}
@@ -76,7 +76,7 @@ impl From<OptionValue> for String {
fn from(value: OptionValue) -> Self {
match value {
OptionValue::String(value) => value,
- _ => unreachable("Error converting OptionValue to String."),
+ _ => delta_unreachable("Error converting OptionValue to String."),
}
}
}
@@ -91,7 +91,7 @@ impl From<OptionValue> for usize {
fn from(value: OptionValue) -> Self {
match value {
OptionValue::Int(value) => value,
- _ => unreachable("Error converting OptionValue to usize."),
+ _ => delta_unreachable("Error converting OptionValue to usize."),
}
}
}
diff --git a/src/parse_style.rs b/src/parse_style.rs
index c06919f5..e24e7921 100644
--- a/src/parse_style.rs
+++ b/src/parse_style.rs
@@ -3,7 +3,7 @@ use std::process;
use bitflags::bitflags;
use crate::color;
-use crate::config::unreachable;
+use crate::config::delta_unreachable;
use crate::style::{DecorationStyle, Style};
impl Style {
@@ -156,7 +156,7 @@ impl DecorationStyle {
bits if bits == BOX | OL => DecorationStyle::BoxWithOverline(style),
bits if bits == BOX | UL | OL => DecorationStyle::BoxWithUnderOverline(style),
_ if is_omitted => DecorationStyle::NoDecoration,
- _ => unreachable("Unreachable code path reached in parse_decoration_style."),
+ _ => delta_unreachable("Unreachable code path reached in parse_decoration_style."),
}
}