Skip to content

Commit

Permalink
Remove superfluous lowercasing of feature names.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tak committed Sep 15, 2021
1 parent 8069189 commit 9b8863a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
12 changes: 10 additions & 2 deletions src/options/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub trait GetOptionValue {
return Some(value);
}
}
for feature in opt.features.to_lowercase().split_whitespace().rev() {
for feature in opt.features.split_whitespace().rev() {
match Self::get_provenanced_value_for_feature(
option_name,
feature,
Expand Down Expand Up @@ -316,6 +316,9 @@ pub mod tests {
light = true
dark = true
[delta "Uppercase-Theme"]
light = true
[delta "not-a-theme"]
max-line-distance = 0.6
"#;
Expand All @@ -331,7 +334,12 @@ pub mod tests {

assert_eq!(
themes,
["dark-theme", "light-and-dark-theme", "light-theme",]
[
"dark-theme",
"light-and-dark-theme",
"light-theme",
"Uppercase-Theme"
]
);

remove_file(git_config_path).unwrap();
Expand Down
6 changes: 3 additions & 3 deletions src/options/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,11 @@ fn gather_features(

// Gather features from command line.
if let Some(git_config) = git_config {
for feature in split_feature_string(&opt.features.to_lowercase()) {
for feature in split_feature_string(&opt.features) {
gather_features_recursively(feature, &mut features, builtin_features, opt, git_config);
}
} else {
for feature in split_feature_string(&opt.features.to_lowercase()) {
for feature in split_feature_string(&opt.features) {
features.push_front(feature.to_string());
}
}
Expand Down Expand Up @@ -348,7 +348,7 @@ fn gather_features(
// Gather features from [delta] section if --features was not passed.
if opt.features.is_empty() {
if let Some(feature_string) = git_config.get::<String>("delta.features") {
for feature in split_feature_string(&feature_string.to_lowercase()) {
for feature in split_feature_string(&feature_string) {
gather_features_recursively(
feature,
&mut features,
Expand Down

0 comments on commit 9b8863a

Please sign in to comment.