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
2323 }
2424
2525 /// Access and conversions
26−impl ValueRef<'_> {
26+impl<'a> ValueRef<'a> {
2727 /// Access this value as byte string.
28− pub fn as_bstr(&self) -> &BStr {
28+ pub fn as_bstr(&self) -> &'a BStr {
2929 self.0.as_bytes().as_bstr()
3030 }
3131