From 14d16de3b81881a7ed6416784197e80dd73e8967 Mon Sep 17 00:00:00 2001 From: Adrian Taylor Date: Fri, 12 Jan 2024 12:10:23 +0000 Subject: [PATCH] Fix ambiguous lifetimes This type of ambiguous lifetime may shortly be forbidden by https://github.com/rust-lang/rust/pull/117967 --- src/serialization.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/serialization.rs b/src/serialization.rs index a4dacd3..7f1d38d 100644 --- a/src/serialization.rs +++ b/src/serialization.rs @@ -307,11 +307,11 @@ fn deserialize_scalar(input: &mut &[u8]) -> Result { } trait SliceExt { - fn take_ext(self: &mut &Self, take: usize) -> Option<&Self>; + fn take_ext<'a>(self: &mut &'a Self, take: usize) -> Option<&'a Self>; } impl SliceExt for [T] { - fn take_ext(self: &mut &Self, take: usize) -> Option<&Self> { + fn take_ext<'a>(self: &mut &'a Self, take: usize) -> Option<&'a Self> { if take > self.len() { return None; }