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 <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37097>
This commit is contained in:
Gurchetan Singh 2025-08-29 15:45:00 -07:00 committed by Marge Bot
parent fcf8899c9e
commit 68f957292e

View file

@ -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 }
}