summaryrefslogtreecommitdiffstats
path: root/src/file/format/yaml.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/file/format/yaml.rs')
-rw-r--r--src/file/format/yaml.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/file/format/yaml.rs b/src/file/format/yaml.rs
index c9c8a22..b35ba4d 100644
--- a/src/file/format/yaml.rs
+++ b/src/file/format/yaml.rs
@@ -4,6 +4,7 @@ use std::mem;
use yaml_rust as yaml;
+use crate::format;
use crate::map::Map;
use crate::value::{Value, ValueKind};
@@ -21,13 +22,8 @@ pub fn parse(
}
};
- // TODO: Have a proper error fire if the root of a file is ever not a Table
let value = from_yaml_value(uri, &root)?;
- match value.kind {
- ValueKind::Table(map) => Ok(map),
-
- _ => Ok(Map::new()),
- }
+ format::extract_root_table(uri, value)
}
fn from_yaml_value(