Skip to content

Commit 2bbfe6d

Browse files
committed
thanks clippy
1 parent 6938c19 commit 2bbfe6d

File tree

115 files changed

+232
-231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+232
-231
lines changed

gitoxide-core/src/hours/util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ pub struct WorkByPerson {
1414
pub lines: LineStats,
1515
}
1616

17-
impl<'a> WorkByPerson {
18-
pub fn merge(&mut self, other: &'a WorkByEmail) {
17+
impl WorkByPerson {
18+
pub fn merge(&mut self, other: &WorkByEmail) {
1919
if !self.name.contains(&other.name) {
2020
self.name.push(other.name);
2121
}

gitoxide-core/src/query/engine/update.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ pub fn update(
369369
}
370370
}
371371

372-
impl<'a, Find> gix::prelude::Find for Db<'a, Find>
372+
impl<Find> gix::prelude::Find for Db<'_, Find>
373373
where
374374
Find: gix::prelude::Find + Clone,
375375
{

gitoxide-core/src/repository/revision/explain.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl<'a> Explain<'a> {
5555
}
5656
}
5757

58-
impl<'a> delegate::Revision for Explain<'a> {
58+
impl delegate::Revision for Explain<'_> {
5959
fn find_ref(&mut self, name: &BStr) -> Option<()> {
6060
self.prefix()?;
6161
self.ref_name = Some(name.into());
@@ -121,7 +121,7 @@ impl<'a> delegate::Revision for Explain<'a> {
121121
}
122122
}
123123

124-
impl<'a> delegate::Navigate for Explain<'a> {
124+
impl delegate::Navigate for Explain<'_> {
125125
fn traverse(&mut self, kind: Traversal) -> Option<()> {
126126
self.prefix()?;
127127
let name = self.revision_name();
@@ -194,7 +194,7 @@ impl<'a> delegate::Navigate for Explain<'a> {
194194
}
195195
}
196196

197-
impl<'a> delegate::Kind for Explain<'a> {
197+
impl delegate::Kind for Explain<'_> {
198198
fn kind(&mut self, kind: spec::Kind) -> Option<()> {
199199
self.prefix()?;
200200
self.call = 0;
@@ -215,7 +215,7 @@ impl<'a> delegate::Kind for Explain<'a> {
215215
}
216216
}
217217

218-
impl<'a> Delegate for Explain<'a> {
218+
impl Delegate for Explain<'_> {
219219
fn done(&mut self) {
220220
if !self.has_implicit_anchor && self.ref_name.is_none() && self.oid_prefix.is_none() {
221221
self.err = Some("Incomplete specification lacks its anchor, like a reference or object name".into());

gitoxide-core/src/repository/tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ mod entries {
6565
}
6666
}
6767

68-
impl<'repo, 'a> gix::traverse::tree::Visit for Traverse<'repo, 'a> {
68+
impl gix::traverse::tree::Visit for Traverse<'_, '_> {
6969
fn pop_front_tracked_path_and_set_current(&mut self) {
7070
self.path = self.path_deque.pop_front().expect("every parent is set only once");
7171
}

gix-actor/src/identity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ mod write {
4040
}
4141
}
4242

43-
impl<'a> IdentityRef<'a> {
43+
impl IdentityRef<'_> {
4444
/// Serialize this instance to `out` in the git serialization format for signatures (but without timestamp).
4545
pub fn write_to(&self, out: &mut dyn std::io::Write) -> std::io::Result<()> {
4646
out.write_all(validated_token(self.name)?)?;

gix-actor/src/signature/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub(crate) mod write {
104104
}
105105
}
106106

107-
impl<'a> SignatureRef<'a> {
107+
impl SignatureRef<'_> {
108108
/// Serialize this instance to `out` in the git serialization format for actors.
109109
pub fn write_to(&self, out: &mut dyn std::io::Write) -> std::io::Result<()> {
110110
out.write_all(validated_token(self.name)?)?;

gix-attributes/src/name.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::{Name, NameRef};
22
use bstr::{BStr, BString, ByteSlice};
33
use kstring::KStringRef;
44

5-
impl<'a> NameRef<'a> {
5+
impl NameRef<'_> {
66
/// Turn this ref into its owned counterpart.
77
pub fn to_owned(self) -> Name {
88
Name(self.0.into())

gix-attributes/src/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl<'a> StateRef<'a> {
9696
}
9797

9898
/// Access
99-
impl<'a> StateRef<'a> {
99+
impl StateRef<'_> {
100100
/// Turn ourselves into our owned counterpart.
101101
pub fn to_owned(self) -> State {
102102
self.into()

gix-commitgraph/src/file/commit.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ impl<'a> Commit<'a> {
106106
}
107107
}
108108

109-
impl<'a> Debug for Commit<'a> {
109+
impl Debug for Commit<'_> {
110110
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
111111
write!(
112112
f,
@@ -121,9 +121,9 @@ impl<'a> Debug for Commit<'a> {
121121
}
122122
}
123123

124-
impl<'a> Eq for Commit<'a> {}
124+
impl Eq for Commit<'_> {}
125125

126-
impl<'a> PartialEq for Commit<'a> {
126+
impl PartialEq for Commit<'_> {
127127
fn eq(&self, other: &Self) -> bool {
128128
std::ptr::eq(self.file, other.file) && self.pos == other.pos
129129
}
@@ -135,7 +135,7 @@ pub struct Parents<'a> {
135135
state: ParentIteratorState<'a>,
136136
}
137137

138-
impl<'a> Iterator for Parents<'a> {
138+
impl Iterator for Parents<'_> {
139139
type Item = Result<Position, Error>;
140140

141141
fn next(&mut self) -> Option<Self::Item> {

gix-config-value/src/path.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,21 +86,21 @@ pub mod interpolate {
8686
}
8787
}
8888

89-
impl<'a> std::ops::Deref for Path<'a> {
89+
impl std::ops::Deref for Path<'_> {
9090
type Target = BStr;
9191

9292
fn deref(&self) -> &Self::Target {
9393
self.value.as_ref()
9494
}
9595
}
9696

97-
impl<'a> AsRef<[u8]> for Path<'a> {
97+
impl AsRef<[u8]> for Path<'_> {
9898
fn as_ref(&self) -> &[u8] {
9999
self.value.as_ref()
100100
}
101101
}
102102

103-
impl<'a> AsRef<BStr> for Path<'a> {
103+
impl AsRef<BStr> for Path<'_> {
104104
fn as_ref(&self) -> &BStr {
105105
self.value.as_ref()
106106
}

gix-config/src/file/access/comfort.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use bstr::BStr;
55
use crate::{file::MetadataFilter, value, AsKey, File};
66

77
/// Comfortable API for accessing values
8-
impl<'event> File<'event> {
8+
impl File<'_> {
99
/// Like [`string_by()`](File::string_by()), but suitable for statically known `key`s like `remote.origin.url`.
1010
pub fn string(&self, key: impl AsKey) -> Option<Cow<'_, BStr>> {
1111
self.string_filter(key, &mut |_| true)

gix-config/src/file/mutable/multi_value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub struct MultiValueMut<'borrow, 'lookup, 'event> {
3535
pub(crate) offsets: HashMap<SectionId, Vec<usize>>,
3636
}
3737

38-
impl<'borrow, 'lookup, 'event> MultiValueMut<'borrow, 'lookup, 'event> {
38+
impl<'lookup, 'event> MultiValueMut<'_, 'lookup, 'event> {
3939
/// Returns the actual values.
4040
pub fn get(&self) -> Result<Vec<Cow<'_, BStr>>, lookup::existing::Error> {
4141
let mut expect_value = false;

gix-config/src/file/mutable/section.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub struct SectionMut<'a, 'event> {
2727
}
2828

2929
/// Mutating methods.
30-
impl<'a, 'event> SectionMut<'a, 'event> {
30+
impl<'event> SectionMut<'_, 'event> {
3131
/// Adds an entry to the end of this section name `value_name` and `value`. If `value` is `None`, no equal sign will be written leaving
3232
/// just the key. This is useful for boolean values which are true if merely the key exists.
3333
pub fn push<'b>(&mut self, value_name: ValueName<'event>, value: Option<&'b BStr>) -> &mut Self {

gix-config/src/file/mutable/value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub struct ValueMut<'borrow, 'lookup, 'event> {
1818
pub(crate) size: Size,
1919
}
2020

21-
impl<'borrow, 'lookup, 'event> ValueMut<'borrow, 'lookup, 'event> {
21+
impl<'borrow, 'event> ValueMut<'borrow, '_, 'event> {
2222
/// Returns the actual value. This is computed each time this is called
2323
/// requiring an allocation for multi-line values.
2424
pub fn get(&self) -> Result<Cow<'_, BStr>, lookup::existing::Error> {

gix-config/src/file/section/body.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl<'event> Body<'event> {
120120
}
121121
}
122122

123-
impl<'event> Body<'event> {
123+
impl Body<'_> {
124124
pub(crate) fn as_ref(&self) -> &[Event<'_>] {
125125
&self.0
126126
}

gix-diff/src/rewrites/tracker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ mod diff {
641641
pub input: &'a crate::blob::intern::InternedInput<&'data [u8]>,
642642
}
643643

644-
impl<'a, 'data> crate::blob::Sink for Statistics<'a, 'data> {
644+
impl crate::blob::Sink for Statistics<'_, '_> {
645645
type Out = usize;
646646

647647
fn process_change(&mut self, before: Range<u32>, _after: Range<u32>) {

gix-diff/src/tree/changes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub enum Error {
2020
EntriesDecode(#[from] gix_object::decode::Error),
2121
}
2222

23-
impl<'a> tree::Changes<'a> {
23+
impl tree::Changes<'_> {
2424
/// Calculate the changes that would need to be applied to `self` to get `other` using `objects` to obtain objects as needed for traversal.
2525
///
2626
/// * The `state` maybe owned or mutably borrowed to allow reuses allocated data structures through multiple runs.

gix-dir/tests/walk_utils/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ impl<'a> Options<'a> {
374374
}
375375
}
376376

377-
impl<'a> Default for Options<'a> {
377+
impl Default for Options<'_> {
378378
fn default() -> Self {
379379
Options {
380380
fresh_index: true,

gix-features/src/interrupt.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ where
2929
}
3030
}
3131

32-
impl<'a, I> Iterator for Iter<'a, I>
32+
impl<I> Iterator for Iter<'_, I>
3333
where
3434
I: Iterator,
3535
{
@@ -67,7 +67,7 @@ where
6767
}
6868
}
6969

70-
impl<'a, I, EFN, E> Iterator for IterWithErr<'a, I, EFN>
70+
impl<I, EFN, E> Iterator for IterWithErr<'_, I, EFN>
7171
where
7272
I: Iterator,
7373
EFN: FnOnce() -> E,
@@ -99,7 +99,7 @@ pub struct Read<'a, R> {
9999
pub should_interrupt: &'a AtomicBool,
100100
}
101101

102-
impl<'a, R> io::Read for Read<'a, R>
102+
impl<R> io::Read for Read<'_, R>
103103
where
104104
R: io::Read,
105105
{
@@ -111,7 +111,7 @@ where
111111
}
112112
}
113113

114-
impl<'a, R> io::BufRead for Read<'a, R>
114+
impl<R> io::BufRead for Read<'_, R>
115115
where
116116
R: io::BufRead,
117117
{

gix-filter/src/driver/process/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ struct ReadProcessOutputAndStatus<'a> {
256256
inner: PacketlineReader<'a>,
257257
}
258258

259-
impl<'a> std::io::Read for ReadProcessOutputAndStatus<'a> {
259+
impl std::io::Read for ReadProcessOutputAndStatus<'_> {
260260
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
261261
let num_read = self.inner.read(buf)?;
262262
if num_read == 0 {

gix-filter/src/pipeline/convert.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ pub enum ToWorktreeOutcome<'input, 'pipeline> {
260260
Process(driver::apply::MaybeDelayed<'pipeline>),
261261
}
262262

263-
impl<'input, 'pipeline> ToWorktreeOutcome<'input, 'pipeline> {
263+
impl ToWorktreeOutcome<'_, '_> {
264264
/// Return true if this outcome is delayed. In that case, one isn't allowed to use [`Read`] or cause a panic.
265265
pub fn is_delayed(&self) -> bool {
266266
matches!(
@@ -297,7 +297,7 @@ impl<'input, 'pipeline> ToWorktreeOutcome<'input, 'pipeline> {
297297
}
298298
}
299299

300-
impl<'input, 'pipeline> std::io::Read for ToWorktreeOutcome<'input, 'pipeline> {
300+
impl std::io::Read for ToWorktreeOutcome<'_, '_> {
301301
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
302302
match self {
303303
ToWorktreeOutcome::Unchanged(b) => b.read(buf),
@@ -310,7 +310,7 @@ impl<'input, 'pipeline> std::io::Read for ToWorktreeOutcome<'input, 'pipeline> {
310310
}
311311
}
312312

313-
impl<'pipeline, R> std::io::Read for ToGitOutcome<'pipeline, R>
313+
impl<R> std::io::Read for ToGitOutcome<'_, R>
314314
where
315315
R: std::io::Read,
316316
{

gix-fs/src/dir/create.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ mod error {
4747
},
4848
}
4949

50-
impl<'a> fmt::Display for Error<'a> {
50+
impl fmt::Display for Error<'_> {
5151
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5252
match self {
5353
Error::Intermediate { dir, kind } => write!(
@@ -69,7 +69,7 @@ mod error {
6969
}
7070
}
7171

72-
impl<'a> std::error::Error for Error<'a> {
72+
impl std::error::Error for Error<'_> {
7373
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
7474
match self {
7575
Error::Permanent { err, .. } => Some(err),

gix-hash/src/oid.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub struct HexDisplay<'a> {
4141
hex_len: usize,
4242
}
4343

44-
impl<'a> std::fmt::Display for HexDisplay<'a> {
44+
impl std::fmt::Display for HexDisplay<'_> {
4545
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4646
let mut hex = Kind::hex_buf();
4747
let max_len = self.inner.hex_to_buf(hex.as_mut());

gix-ignore/src/parse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ impl<'a> Lines<'a> {
1717
}
1818
}
1919

20-
impl<'a> Iterator for Lines<'a> {
20+
impl Iterator for Lines<'_> {
2121
type Item = (gix_glob::Pattern, usize, crate::Kind);
2222

2323
fn next(&mut self) -> Option<Self::Item> {

gix-index/src/access/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ impl State {
389389
}
390390
}
391391

392-
impl<'a> AccelerateLookup<'a> {
392+
impl AccelerateLookup<'_> {
393393
fn with_capacity(cap: usize) -> Self {
394394
let ratio_of_entries_to_dirs_in_webkit = 20; // 400k entries and 20k dirs
395395
Self {

gix-negotiate/tests/baseline/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl<'a> ParseRounds<'a> {
154154
}
155155
}
156156

157-
impl<'a> Iterator for ParseRounds<'a> {
157+
impl Iterator for ParseRounds<'_> {
158158
type Item = Round;
159159

160160
fn next(&mut self) -> Option<Self::Item> {

gix-object/src/blob.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::{convert::Infallible, io};
22

33
use crate::{Blob, BlobRef, Kind};
44

5-
impl<'a> crate::WriteTo for BlobRef<'a> {
5+
impl crate::WriteTo for BlobRef<'_> {
66
/// Write the blobs data to `out` verbatim.
77
fn write_to(&self, out: &mut dyn io::Write) -> io::Result<()> {
88
out.write_all(self.data)
@@ -39,7 +39,7 @@ impl Blob {
3939
}
4040
}
4141

42-
impl<'a> BlobRef<'a> {
42+
impl BlobRef<'_> {
4343
/// Instantiate a `Blob` from the given `data`, which is used as-is.
4444
pub fn from_bytes(data: &[u8]) -> Result<BlobRef<'_>, Infallible> {
4545
Ok(BlobRef { data })

gix-object/src/commit/message/body.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ impl<'a> BodyRef<'a> {
101101
}
102102
}
103103

104-
impl<'a> AsRef<BStr> for BodyRef<'a> {
104+
impl AsRef<BStr> for BodyRef<'_> {
105105
fn as_ref(&self) -> &BStr {
106106
self.body_without_trailer
107107
}
108108
}
109109

110-
impl<'a> Deref for BodyRef<'a> {
110+
impl Deref for BodyRef<'_> {
111111
type Target = BStr;
112112

113113
fn deref(&self) -> &Self::Target {

0 commit comments

Comments
 (0)