diff options
author | Ryan Leckey <ryan@launchbadge.com> | 2017-06-22 23:16:52 -0700 |
---|---|---|
committer | Ryan Leckey <ryan@launchbadge.com> | 2017-06-22 23:16:52 -0700 |
commit | de8b0ebf3054031156ea2412f4e16c74d47cb3ab (patch) | |
tree | cfe8c1f15492ffd75b31ef466ebb76d25c514d58 | |
parent | 4181e26b193d503dadee8842e1cc9451061ce29a (diff) |
:memo: on remaining unwraps
-rw-r--r-- | src/file/format/mod.rs | 3 | ||||
-rw-r--r-- | src/file/format/yaml.rs | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/file/format/mod.rs b/src/file/format/mod.rs index 366fa45..b3cf279 100644 --- a/src/file/format/mod.rs +++ b/src/file/format/mod.rs @@ -54,6 +54,9 @@ impl FileFormat { // TODO: pub(crate) #[doc(hidden)] pub fn extensions(&self) -> &'static Vec<&'static str> { + // It should not be possible for this to fail + // A FileFormat would need to be declared without being added to the + // ALL_EXTENSIONS map. ALL_EXTENSIONS.get(self).unwrap() } diff --git a/src/file/format/yaml.rs b/src/file/format/yaml.rs index 4911679..4040ea6 100644 --- a/src/file/format/yaml.rs +++ b/src/file/format/yaml.rs @@ -30,6 +30,7 @@ fn from_yaml_value(uri: Option<&String>, value: &yaml::Yaml) -> Value { match *value { yaml::Yaml::String(ref value) => Value::new(uri, ValueKind::String(value.clone())), yaml::Yaml::Real(ref value) => { + // TODO: Figure out in what cases this can panic? Value::new(uri, ValueKind::Float(value.parse::<f64>().unwrap())) } yaml::Yaml::Integer(value) => Value::new(uri, ValueKind::Integer(value)), |