From 68f957292ef3e7a6687c9b3b6525a40b119d7555 Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Fri, 29 Aug 2025 15:45:00 -0700 Subject: [PATCH] util: rust: fix some warnings Fixes some warnings. 21 | pub fn new(data: &[u8]) -> Reader { | ^^^^^ ------ the same lifetime is hidden here | | | the lifetime is elided here | = help: the same lifetime is referred to in inconsistent ways, making the signature confusing = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default help: use `'_` for type paths | 21 | pub fn new(data: &[u8]) -> Reader<'_> { | ++++ Reviewed-by: David Gilhooley Part-of: --- src/util/rust/bytestream/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/rust/bytestream/mod.rs b/src/util/rust/bytestream/mod.rs index fbffc5b9ba4..c0d3ff5fe71 100644 --- a/src/util/rust/bytestream/mod.rs +++ b/src/util/rust/bytestream/mod.rs @@ -18,7 +18,7 @@ pub struct Reader<'slice> { impl<'slice> Reader<'slice> { /// Construct a new Reader wrapper over `data`. - pub fn new(data: &[u8]) -> Reader { + pub fn new(data: &[u8]) -> Reader<'_> { Reader { data } } @@ -63,7 +63,7 @@ pub struct Writer<'slice> { } impl<'slice> Writer<'slice> { - pub fn new(data: &mut [u8]) -> Writer { + pub fn new(data: &mut [u8]) -> Writer<'_> { Writer { data, index: 0 } }