Skip to content

Commit

Permalink
Fix Clippy range check
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-zinnatullin committed Sep 14, 2022
1 parent e36a83c commit dc6e11d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/intermediate_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ fn parse_config_from_str(config_content: &str) -> Result<IntermediateConfig, Str
fn parse_compression(yaml: &LinkedHashMap<Yaml, Yaml>, field_name: &str, scope_name: &str) -> Result<Option<u8>, String> {
match yaml.get(&Yaml::String(field_name.to_string())).cloned() {
Some(compression) => match compression {
Yaml::Integer(compression) => if compression >= 1 && compression <= 9 {
Yaml::Integer(compression) => if (1..=9).contains(&compression) {
Ok(Some(compression as u8))
} else {
Err(format!("'{}.{}' must be a positive integer from 1 to 9, but was {:#?}", scope_name, field_name, compression))
Expand Down

0 comments on commit dc6e11d

Please sign in to comment.