Skip to content

Commit 3aea9e0

Browse files
committed
chore: Use the common parser root check method
Signed-off-by: Brennan Kinney <[email protected]>
1 parent 60c1655 commit 3aea9e0

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/file/format/gura.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use std::error::Error;
22

33
use gura::GuraType;
44

5+
use crate::format;
56
use crate::map::Map;
67
use crate::value::{Value, ValueKind};
78

@@ -10,11 +11,7 @@ pub fn parse(
1011
text: &str,
1112
) -> Result<Map<String, Value>, Box<dyn Error + Send + Sync>> {
1213
let value = from_gura_value(uri, gura::parse(text).unwrap());
13-
match value.kind {
14-
ValueKind::Table(map) => Ok(map),
15-
16-
_ => Ok(Map::new()),
17-
}
14+
format::extract_root_table(uri, value)
1815
}
1916

2017
fn from_gura_value(uri: Option<&String>, value: GuraType) -> Value {

0 commit comments

Comments
 (0)