diff options
author | Dan Davison <dandavison7@gmail.com> | 2020-06-20 23:28:16 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2020-06-20 23:28:16 -0400 |
commit | 50744ccd52320cb332fba1ffa413b93965789906 (patch) | |
tree | 2a808b2354f5c36f1c172dd5ce5fbc849f588646 /src/features | |
parent | 7d36236e929d24a84fcac02985ab607a5eef4806 (diff) |
Rename type
Diffstat (limited to 'src/features')
-rw-r--r-- | src/features/diff_highlight.rs | 6 | ||||
-rw-r--r-- | src/features/diff_so_fancy.rs | 4 | ||||
-rw-r--r-- | src/features/mod.rs | 6 | ||||
-rw-r--r-- | src/features/navigate.rs | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/src/features/diff_highlight.rs b/src/features/diff_highlight.rs index e339474b..35b71c4b 100644 --- a/src/features/diff_highlight.rs +++ b/src/features/diff_highlight.rs @@ -1,10 +1,10 @@ -use crate::features::FeatureValueFunction; +use crate::features::OptionValueFunction; -pub fn make_feature() -> Vec<(String, FeatureValueFunction)> { +pub fn make_feature() -> Vec<(String, OptionValueFunction)> { _make_feature(false) } -pub fn _make_feature(bold: bool) -> Vec<(String, FeatureValueFunction)> { +pub fn _make_feature(bold: bool) -> Vec<(String, OptionValueFunction)> { builtin_feature!([ ( "minus-style", diff --git a/src/features/diff_so_fancy.rs b/src/features/diff_so_fancy.rs index 0013ef37..8b7d0299 100644 --- a/src/features/diff_so_fancy.rs +++ b/src/features/diff_so_fancy.rs @@ -1,7 +1,7 @@ use crate::features::diff_highlight; -use crate::features::FeatureValueFunction; +use crate::features::OptionValueFunction; -pub fn make_feature() -> Vec<(String, FeatureValueFunction)> { +pub fn make_feature() -> Vec<(String, OptionValueFunction)> { let mut feature = diff_highlight::_make_feature(true); feature.extend(builtin_feature!([ ( diff --git a/src/features/mod.rs b/src/features/mod.rs index 7f7add46..4232cd4e 100644 --- a/src/features/mod.rs +++ b/src/features/mod.rs @@ -14,9 +14,9 @@ use crate::git_config::GitConfig; /// A builtin feature is a named set of command line (option, value) pairs that is built in to /// delta. The implementation stores each value as a function, which allows the value (a) to depend /// dynamically on the value of other command line options, and (b) to be taken from git config. -pub type BuiltinFeature = HashMap<String, FeatureValueFunction>; +pub type BuiltinFeature = HashMap<String, OptionValueFunction>; -type FeatureValueFunction = Box<dyn Fn(&cli::Opt, &Option<GitConfig>) -> OptionValue>; +type OptionValueFunction = Box<dyn Fn(&cli::Opt, &Option<GitConfig>) -> OptionValue>; pub enum OptionValue { Boolean(bool), @@ -64,7 +64,7 @@ macro_rules! builtin_feature { _ => None, } .unwrap_or_else(|| $value.into()) - }) as FeatureValueFunction + }) as OptionValueFunction ) ),*] } diff --git a/src/features/navigate.rs b/src/features/navigate.rs index 111f9167..a5839486 100644 --- a/src/features/navigate.rs +++ b/src/features/navigate.rs @@ -1,9 +1,9 @@ /// Activate diff navigation: use n to jump forwards and N to jump backwards. To change the /// file labels used see --file-modified-label, --file-removed-label, --file-added-label, /// --file-renamed-label. -use crate::features::FeatureValueFunction; +use crate::features::OptionValueFunction; -pub fn make_feature() -> Vec<(String, FeatureValueFunction)> { +pub fn make_feature() -> Vec<(String, OptionValueFunction)> { builtin_feature!([ ( "navigate", |