aboutsummaryrefslogtreecommitdiffstats
path: root/nihav-core/src/options.rs
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2023-02-17 18:23:38 +0100
committerKostya Shishkov <kostya.shishkov@gmail.com>2023-02-17 18:23:38 +0100
commit405cec9eed5d7f58440ec8495f5cbc1f5c6fee40 (patch)
treea115c0efc0cf1d50e54590dcb1663fec4a9751c4 /nihav-core/src/options.rs
parentf638a5b1b3241b3433689983aca22d9e6518a64f (diff)
downloadnihav-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.rs12
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 {