From 817446b403b147a9486d0d6f6e7b96ab31d9c226 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Sat, 27 Jun 2020 19:46:46 -0400 Subject: Rename: unreachable -> delta_unreachable --- src/config.rs | 4 ++-- src/option_value.rs | 12 ++++++------ src/parse_style.rs | 4 ++-- 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 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 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 for Option { fn from(value: OptionValue) -> Self { match value { OptionValue::OptionString(value) => value, - _ => unreachable("Error converting OptionValue to Option."), + _ => delta_unreachable("Error converting OptionValue to Option."), } } } @@ -76,7 +76,7 @@ impl From 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 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."), } } -- cgit v1.2.3