Skip to content

Commit

Permalink
Add Value::origin()
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
  • Loading branch information
matthiasbeyer committed Jun 19, 2022
1 parent a6414bb commit edc96c9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ impl Value {
}
}

/// Get the description of the original location of the value.
pub fn origin(&self) -> Option<&str> {
self.origin.as_ref().map(AsRef::as_ref)
}

/// Attempt to deserialize this value into the requested type.
pub fn try_deserialize<'de, T: Deserialize<'de>>(self) -> Result<T> {
T::deserialize(self)
Expand Down

0 comments on commit edc96c9

Please sign in to comment.