Skip to content

Commit 6d16348

Browse files
committed
Value: Fix lifetime of error message
The lifetime of the error message was tied to the lifetime of the Value.
1 parent 63c2d23 commit 6d16348

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/value.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl Value {
221221

222222
/// Encode value as big-endian byte string.
223223
/// Fails if underlying bit string has length not divisible by 8
224-
pub fn try_to_bytes(&self) -> Result<Vec<u8>, &str> {
224+
pub fn try_to_bytes(&self) -> Result<Vec<u8>, &'static str> {
225225
let (bytes, bit_length) = self.to_bytes_len();
226226

227227
if bit_length % 8 == 0 {

0 commit comments

Comments
 (0)