From 3aea9e07dd71492824ce58ed1a545498f0583949 Mon Sep 17 00:00:00 2001 From: polarathene <5098581+polarathene@users.noreply.github.com> Date: Sat, 7 Oct 2023 22:41:24 +1300 Subject: [PATCH] chore: Use the common parser root check method Signed-off-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com> --- src/file/format/gura.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/file/format/gura.rs b/src/file/format/gura.rs index 1ff0665c..9f146698 100644 --- a/src/file/format/gura.rs +++ b/src/file/format/gura.rs @@ -2,6 +2,7 @@ use std::error::Error; use gura::GuraType; +use crate::format; use crate::map::Map; use crate::value::{Value, ValueKind}; @@ -10,11 +11,7 @@ pub fn parse( text: &str, ) -> Result, Box> { let value = from_gura_value(uri, gura::parse(text).unwrap()); - match value.kind { - ValueKind::Table(map) => Ok(map), - - _ => Ok(Map::new()), - } + format::extract_root_table(uri, value) } fn from_gura_value(uri: Option<&String>, value: GuraType) -> Value {