Skip to content

Commit

Permalink
feat: Add from_body to Deserializer (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasPickering authored Jan 10, 2025
1 parent 4c92c4e commit 9d05b40
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/hcl-rs/src/de/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ impl Deserializer {
let body = parser::parse(input)?;
Ok(Deserializer { body })
}

/// Creates a HCL deserializer from a HCL body
pub fn from_body(body: Body) -> Self {
Self { body }
}
}

/// Deserialize an instance of type `T` from a string of HCL text.
Expand Down

0 comments on commit 9d05b40

Please sign in to comment.