X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-core%2Fsrc%2Foptions.rs;h=d065892dddd4d81f233935ba25e36d38875df6c4;hb=HEAD;hp=4e4c7aa7753759c9a8b087d752f031c7b4edc805;hpb=6f2630992fe340ad1a122ec10c649f756e478185;p=nihav.git diff --git a/nihav-core/src/options.rs b/nihav-core/src/options.rs index 4e4c7aa..d065892 100644 --- a/nihav-core/src/options.rs +++ b/nihav-core/src/options.rs @@ -89,8 +89,8 @@ impl NAOptionDefinition { NAOptionDefinitionType::None => Ok((NAOption { name: self.name, value: NAValue::None }, 1)), NAOptionDefinitionType::Bool => Ok((NAOption { name: self.name, value: NAValue::Bool(true) }, 1)), NAOptionDefinitionType::Int(_, _) => { - if let Some(str) = value { - let ret = str.parse::(); + if let Some(strval) = value { + let ret = strval.parse::(); if let Ok(val) = ret { let opt = NAOption { name: self.name, value: NAValue::Int(val) }; self.check(&opt)?; @@ -103,8 +103,8 @@ impl NAOptionDefinition { } }, NAOptionDefinitionType::Float(_, _) => { - if let Some(str) = value { - let ret = str.parse::(); + if let Some(strval) = value { + let ret = strval.parse::(); if let Ok(val) = ret { let opt = NAOption { name: self.name, value: NAValue::Float(val) }; self.check(&opt)?; @@ -117,8 +117,8 @@ impl NAOptionDefinition { } }, NAOptionDefinitionType::String(_) => { - if let Some(str) = value { - let opt = NAOption { name: self.name, value: NAValue::String(str.to_string()) }; + if let Some(strval) = value { + let opt = NAOption { name: self.name, value: NAValue::String(strval.to_string()) }; self.check(&opt)?; Ok((opt, 2)) } else { @@ -184,8 +184,8 @@ impl NAOptionDefinition { }, NAValue::String(ref cur_str) => { if let NAOptionDefinitionType::String(Some(strings)) = self.opt_type { - for str in strings.iter() { - if cur_str == str { + for string in strings.iter() { + if cur_str == string { return Ok(()); } }