Skip to content

Commit

Permalink
Merge pull request #317 from drewcrawford/generic2
Browse files Browse the repository at this point in the history
Make .get_path generic
  • Loading branch information
ASalvail authored Nov 17, 2020
2 parents 88c553d + a3598f8 commit bebd763
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ impl MemoryReference {
/// `undefined`, and `Err` if incorrect type.
///
/// Uses lodash in JavaScript to evaluate the path. See https://lodash.com/docs/#get.
pub fn get_path<T>(&self, path: &str) -> Result<Option<T>, ConversionError>
pub fn get_path<T>(&self, path: &str) -> Result<Option<T>, <T as TryFrom<Value>>::Error>
where
T: TryFrom<Value, Error = ConversionError>,
T: TryFrom<Value>,
{
let val = js! {
return _.get(@{self.as_ref()}, @{path});
Expand Down

0 comments on commit bebd763

Please sign in to comment.