diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2023-02-17 18:23:38 +0100 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2023-02-17 18:23:38 +0100 |
commit | 405cec9eed5d7f58440ec8495f5cbc1f5c6fee40 (patch) | |
tree | a115c0efc0cf1d50e54590dcb1663fec4a9751c4 /nihav-core/src/options.rs | |
parent | f638a5b1b3241b3433689983aca22d9e6518a64f (diff) | |
download | nihav-405cec9eed5d7f58440ec8495f5cbc1f5c6fee40.tar.gz |
rename "str" variable to avoid confusion with the primitive type
Diffstat (limited to 'nihav-core/src/options.rs')
-rw-r--r-- | nihav-core/src/options.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/nihav-core/src/options.rs b/nihav-core/src/options.rs index b09bf05..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::<i64>(); + if let Some(strval) = value { + let ret = strval.parse::<i64>(); 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::<f64>(); + if let Some(strval) = value { + let ret = strval.parse::<f64>(); 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 { |