Skip to content

Commit

Permalink
fix: Declare lifetime parameters in a consistent order, always (#4)
Browse files Browse the repository at this point in the history
First 'src, then 'val, with 'src: 'val ('src "encompasses" 'val)
  • Loading branch information
fasterthanlime authored Jul 29, 2024
1 parent 4b17502 commit 90148d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ impl<V: JsonSerialize> JsonSerialize for &[(&str, V)] {
}

/// Extension trait to provide `must_get` on `JsonObject<'_>`
pub trait JsonObjectExt<'val, 'src, T>
pub trait JsonObjectExt<'src, 'val, T>
where
'src: 'val,
T: JsonDeserialize<'src, 'val> + 'val,
Expand All @@ -1136,7 +1136,7 @@ where
fn must_get(&'val self, key: &'static str) -> Result<T, MerdeJsonError>;
}

impl<'val, 'src, T> JsonObjectExt<'val, 'src, T> for JsonObject<'src>
impl<'src, 'val, T> JsonObjectExt<'src, 'val, T> for JsonObject<'src>
where
'src: 'val,
T: JsonDeserialize<'src, 'val> + 'val,
Expand Down

0 comments on commit 90148d9

Please sign in to comment.