Skip to content

Commit

Permalink
Make clippy 1.83 happy
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Dec 11, 2024
1 parent dc0a2fb commit c903c52
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/git/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub struct Commit<'a> {
body: &'a [u8],
}

impl<'a> Commit<'a> {
impl Commit<'_> {
pub fn parents(&self) -> &[CommitId] {
&self.parents[..]
}
Expand Down
10 changes: 5 additions & 5 deletions src/hg_bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ impl<'a> Iterator for RevDiffIter<'a> {
}
}

impl<'a> RevDiffPart<'a> {
impl RevDiffPart<'_> {
pub fn start(&self) -> usize {
self.0.start
}
Expand Down Expand Up @@ -605,7 +605,7 @@ pub struct BundlePartReader<'a> {
remaining: Option<&'a mut u32>,
}

impl<'a> Read for BundlePartReader<'a> {
impl Read for BundlePartReader<'_> {
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
match self.version {
BundleVersion::V1 => {
Expand Down Expand Up @@ -707,7 +707,7 @@ impl<'a> BundleWriter<'a> {
}
}

impl<'a> Drop for BundleWriter<'a> {
impl Drop for BundleWriter<'_> {
fn drop(&mut self) {
if self.version == BundleVersion::V2 {
write_bundle2_chunk(&mut *self.writer, &[]).unwrap();
Expand Down Expand Up @@ -741,7 +741,7 @@ impl<'a, const CHUNK_SIZE: usize> BundlePartWriter<'a, CHUNK_SIZE> {
}
}

impl<'a, const CHUNK_SIZE: usize> Drop for BundlePartWriter<'a, CHUNK_SIZE> {
impl<const CHUNK_SIZE: usize> Drop for BundlePartWriter<'_, CHUNK_SIZE> {
fn drop(&mut self) {
self.flush_buf_as_chunk().unwrap();
if self.bundle2_buf.is_some() {
Expand All @@ -751,7 +751,7 @@ impl<'a, const CHUNK_SIZE: usize> Drop for BundlePartWriter<'a, CHUNK_SIZE> {
}
}

impl<'a, const CHUNK_SIZE: usize> Write for BundlePartWriter<'a, CHUNK_SIZE> {
impl<const CHUNK_SIZE: usize> Write for BundlePartWriter<'_, CHUNK_SIZE> {
fn write(&mut self, mut buf: &[u8]) -> io::Result<usize> {
if let Some(bundle2_buf) = self.bundle2_buf.as_mut() {
let full_len = buf.len();
Expand Down
2 changes: 1 addition & 1 deletion src/hg_connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub enum HgArgValue<'a> {
ChangesetArray(&'a [HgChangesetId]),
}

impl<'a> HgArgValue<'a> {
impl HgArgValue<'_> {
pub fn as_string(&self) -> Cow<str> {
match self {
HgArgValue::String(s) => Cow::Borrowed(s),
Expand Down
8 changes: 4 additions & 4 deletions src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ impl<'a, R: Read> LoggingReader<'a, R> {
}
}

impl<'a, R: Read> Read for LoggingReader<'a, R> {
impl<R: Read> Read for LoggingReader<'_, R> {
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
self.reader.read(buf).map(|l| {
self.log.log(&buf[..l]);
Expand All @@ -420,7 +420,7 @@ impl<'a, R: Read> Read for LoggingReader<'a, R> {
}
}

impl<'a, R: BufRead> BufRead for LoggingReader<'a, R> {
impl<R: BufRead> BufRead for LoggingReader<'_, R> {
fn fill_buf(&mut self) -> std::io::Result<&[u8]> {
self.reader.fill_buf()
}
Expand All @@ -444,7 +444,7 @@ impl<'a, R: BufRead> BufRead for LoggingReader<'a, R> {
}
}

impl<'a, R: ExactSizeReadRewind> ExactSizeReadRewind for LoggingReader<'a, R> {
impl<R: ExactSizeReadRewind> ExactSizeReadRewind for LoggingReader<'_, R> {
fn len(&self) -> std::io::Result<u64> {
self.reader.len()
}
Expand Down Expand Up @@ -483,7 +483,7 @@ impl<'a, W: Write> LoggingWriter<'a, W> {
}
}

impl<'a, W: Write> Write for LoggingWriter<'a, W> {
impl<W: Write> Write for LoggingWriter<'_, W> {
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
self.writer.write(buf).map(|l| {
self.log.log(&buf[..l]);
Expand Down
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2357,7 +2357,7 @@ struct ManifestLine<'a> {
path_len: usize,
}

impl<'a> ManifestLine<'a> {
impl ManifestLine<'_> {
fn path(&self) -> &[u8] {
&self.line[..self.path_len]
}
Expand All @@ -2376,19 +2376,19 @@ impl<'a> From<&'a [u8]> for ManifestLine<'a> {
}
}

impl<'a> PartialOrd for ManifestLine<'a> {
impl PartialOrd for ManifestLine<'_> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}

impl<'a> Ord for ManifestLine<'a> {
impl Ord for ManifestLine<'_> {
fn cmp(&self, other: &Self) -> Ordering {
self.path().cmp(other.path())
}
}

impl<'a> Borrow<[u8]> for ManifestLine<'a> {
impl Borrow<[u8]> for ManifestLine<'_> {
fn borrow(&self) -> &[u8] {
self.path()
}
Expand Down
2 changes: 1 addition & 1 deletion src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ pub struct HgChangeset<'a> {
body: &'a [u8],
}

impl<'a> HgChangeset<'a> {
impl HgChangeset<'_> {
pub fn extra(&self) -> Option<ChangesetExtra> {
self.extra.map(ChangesetExtra::from)
}
Expand Down
4 changes: 2 additions & 2 deletions src/version_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl<'a> From<&'a str> for VersionRequest<'a> {
}
}

impl<'a> Default for VersionRequest<'a> {
impl Default for VersionRequest<'_> {
fn default() -> Self {
if *BUILD_BRANCH == Release {
VersionRequest::Tagged
Expand Down Expand Up @@ -103,7 +103,7 @@ impl<'a> VersionRequestChild<'a> {
}
}

impl<'a> Deref for VersionRequestChild<'a> {
impl Deref for VersionRequestChild<'_> {
type Target = SharedChild;
fn deref(&self) -> &SharedChild {
&self.child
Expand Down

0 comments on commit c903c52

Please sign in to comment.