This makes it more usable as the value lives longer than the ref itself.
Unified · Split
| @@ -23,9 +23,9 @@ impl<'a> ValueRef<'a> { · 22 unmodified lines | |||
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | /// Access and conversions | 25 | /// Access and conversions |
| 26 | impl ValueRef<'_> { | 26 | impl<'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 | ||