-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply Clippy lints from Rust 1.78 (#1020)
* fix: Add step to update Stable Rust toolchain When GitHub runners images update their Rust stable channel, this update may not be propagated to all runners at the same time. In such a case CI jobs will use different Rust versions which leads to inconsistent behavior. * fix: Apply clippy lints * fix: Restore deleted `utfdbg` macro * fix: Workaround `clippy:assigning_clones` in `KeyExprFuzzer`
- Loading branch information
1 parent
45e05f0
commit c853eba
Showing
30 changed files
with
60 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
// Contributors: | ||
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
use core::{ptr, str}; | ||
use core::ptr; | ||
|
||
pub(crate) struct Writer { | ||
pub ptr: *mut u8, | ||
|
@@ -118,7 +118,6 @@ impl<'a, S: Split<D> + ?Sized, D: ?Sized> DoubleEndedIterator for Splitter<'a, S | |
pub trait Split<Delimiter: ?Sized> { | ||
fn split_once<'a>(&'a self, delimiter: &Delimiter) -> (&'a Self, &'a Self); | ||
fn try_split_once<'a>(&'a self, delimiter: &Delimiter) -> (&'a Self, Option<&'a Self>); | ||
fn rsplit_once<'a>(&'a self, delimiter: &Delimiter) -> (&'a Self, &'a Self); | ||
fn try_rsplit_once<'a>(&'a self, delimiter: &Delimiter) -> (Option<&'a Self>, &'a Self); | ||
fn splitter<'a>(&'a self, delimiter: &'a Delimiter) -> Splitter<'a, Self, Delimiter> { | ||
Splitter { | ||
|
@@ -134,12 +133,6 @@ impl Split<u8> for [u8] { | |
None => (self, &[]), | ||
} | ||
} | ||
fn rsplit_once<'a>(&'a self, delimiter: &u8) -> (&'a Self, &'a Self) { | ||
match self.iter().rposition(|c| c == delimiter) { | ||
Some(i) => (&self[..i], &self[(i + 1)..]), | ||
None => (&[], self), | ||
} | ||
} | ||
|
||
fn try_split_once<'a>(&'a self, delimiter: &u8) -> (&'a Self, Option<&'a Self>) { | ||
match self.iter().position(|c| c == delimiter) { | ||
|
@@ -164,14 +157,6 @@ impl Split<[u8]> for [u8] { | |
} | ||
(self, &[]) | ||
} | ||
fn rsplit_once<'a>(&'a self, delimiter: &[u8]) -> (&'a Self, &'a Self) { | ||
for i in (0..self.len()).rev() { | ||
if self[..i].ends_with(delimiter) { | ||
return (&self[..(i - delimiter.len())], &self[i..]); | ||
} | ||
} | ||
(&[], self) | ||
} | ||
|
||
fn try_split_once<'a>(&'a self, delimiter: &[u8]) -> (&'a Self, Option<&'a Self>) { | ||
for i in 0..self.len() { | ||
|
@@ -200,14 +185,6 @@ impl<const N: usize> Split<[u8; N]> for [u8] { | |
} | ||
(self, &[]) | ||
} | ||
fn rsplit_once<'a>(&'a self, delimiter: &[u8; N]) -> (&'a Self, &'a Self) { | ||
for i in (0..self.len()).rev() { | ||
if self[..i].ends_with(delimiter) { | ||
return (&self[..(i - delimiter.len())], &self[i..]); | ||
} | ||
} | ||
(&[], self) | ||
} | ||
|
||
fn try_split_once<'a>(&'a self, delimiter: &[u8; N]) -> (&'a Self, Option<&'a Self>) { | ||
for i in 0..self.len() { | ||
|
@@ -228,12 +205,15 @@ impl<const N: usize> Split<[u8; N]> for [u8] { | |
} | ||
} | ||
|
||
#[allow(dead_code)] | ||
pub(crate) trait Utf { | ||
fn utf(&self) -> &str; | ||
} | ||
|
||
#[allow(dead_code)] | ||
impl Utf for [u8] { | ||
fn utf(&self) -> &str { | ||
unsafe { str::from_utf8_unchecked(self) } | ||
unsafe { ::core::str::from_utf8_unchecked(self) } | ||
} | ||
} | ||
/// This macro is generally useful when introducing new matchers to debug them. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -183,7 +183,6 @@ pub enum History { | |
All, | ||
} | ||
|
||
/// | ||
pub enum StorageInsertionResult { | ||
Outdated, | ||
Inserted, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.