History

fix: `ValueRef::as_bstr()` now uses the correct lifetime.

This makes it more usable as the value lives longer than the ref itself.

Sebastian Thiel committed 2 years ago

Commit 21bca6c1 parent 07628461 file · +2 −2Browse files

Unified · Split

gix-attributes/src/state.rs+2−2
@@ -23,9 +23,9 @@ impl<'a> ValueRef<'a> { · 22 unmodified lines
23}23}
24 24
25/// Access and conversions25/// Access and conversions
26impl ValueRef<'_> {26impl<'a> ValueRef<'a> {
27 /// Access this value as byte string.27 /// Access this value as byte string.
28 pub fn as_bstr(&self) -> &BStr {28 pub fn as_bstr(&self) -> &'a BStr {
29 self.0.as_bytes().as_bstr()29 self.0.as_bytes().as_bstr()
30 }30 }
31 31