Skip to content

Commit b3303a3

Browse files
committed
cleanup: fix latest nightly lint warnings
1 parent b5a6bfd commit b3303a3

File tree

8 files changed

+14
-18
lines changed

8 files changed

+14
-18
lines changed

git-branchless-lib/src/core/effects.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ impl Drop for ProgressHandle<'_> {
10001000
}
10011001
}
10021002

1003-
impl<'a> ProgressHandle<'a> {
1003+
impl ProgressHandle<'_> {
10041004
/// Notify the progress meter that the current operation has `total`
10051005
/// discrete units of work, and it's currently `current` units of the way
10061006
/// through the operation.

git-branchless-lib/src/core/node_descriptors.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub enum NodeObject<'repo> {
4444
},
4545
}
4646

47-
impl<'repo> NodeObject<'repo> {
47+
impl NodeObject<'_> {
4848
fn get_oid(&self) -> NonZeroOid {
4949
match self {
5050
NodeObject::Commit { commit } => commit.get_oid(),
@@ -214,7 +214,7 @@ impl<'a> CommitMessageDescriptor<'a> {
214214
}
215215
}
216216

217-
impl<'a> NodeDescriptor for CommitMessageDescriptor<'a> {
217+
impl NodeDescriptor for CommitMessageDescriptor<'_> {
218218
#[instrument]
219219
fn describe_node(
220220
&mut self,
@@ -249,7 +249,7 @@ impl<'a> ObsolescenceExplanationDescriptor<'a> {
249249
}
250250
}
251251

252-
impl<'a> NodeDescriptor for ObsolescenceExplanationDescriptor<'a> {
252+
impl NodeDescriptor for ObsolescenceExplanationDescriptor<'_> {
253253
fn describe_node(
254254
&mut self,
255255
_glyphs: &Glyphs,
@@ -317,7 +317,7 @@ impl<'a> BranchesDescriptor<'a> {
317317
}
318318
}
319319

320-
impl<'a> NodeDescriptor for BranchesDescriptor<'a> {
320+
impl NodeDescriptor for BranchesDescriptor<'_> {
321321
#[instrument]
322322
fn describe_node(
323323
&mut self,
@@ -412,7 +412,7 @@ $",
412412
Some(diff_number.to_owned())
413413
}
414414

415-
impl<'a> NodeDescriptor for DifferentialRevisionDescriptor<'a> {
415+
impl NodeDescriptor for DifferentialRevisionDescriptor<'_> {
416416
#[instrument]
417417
fn describe_node(
418418
&mut self,

git-branchless-lib/src/core/rewrite/evolve.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@ pub fn find_rewrite_target(
1818
event_cursor: EventCursor,
1919
oid: NonZeroOid,
2020
) -> Option<MaybeZeroOid> {
21-
let event = event_replayer.get_cursor_commit_latest_event(event_cursor, oid);
22-
let event = match event {
23-
Some(event) => event,
24-
None => return None,
25-
};
21+
let event = event_replayer.get_cursor_commit_latest_event(event_cursor, oid)?;
2622
match event {
2723
Event::RewriteEvent {
2824
timestamp: _,

git-branchless-lib/src/core/task.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub struct ResourceHandle<'pool, R: Resource> {
8686
inner: Option<R::Output>,
8787
}
8888

89-
impl<'a, R: Resource> Drop for ResourceHandle<'a, R> {
89+
impl<R: Resource> Drop for ResourceHandle<'_, R> {
9090
fn drop(&mut self) {
9191
let mut resources = self
9292
.parent
@@ -97,7 +97,7 @@ impl<'a, R: Resource> Drop for ResourceHandle<'a, R> {
9797
}
9898
}
9999

100-
impl<'a, R: Resource> Deref for ResourceHandle<'a, R> {
100+
impl<R: Resource> Deref for ResourceHandle<'_, R> {
101101
type Target = R::Output;
102102

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

git-branchless-lib/src/git/object.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ pub struct Blob<'repo> {
319319
pub(super) inner: git2::Blob<'repo>,
320320
}
321321

322-
impl<'repo> Blob<'repo> {
322+
impl Blob<'_> {
323323
/// Get the size of the blob in bytes.
324324
pub fn size(&self) -> u64 {
325325
self.inner.size().try_into().unwrap()

git-branchless-lib/src/git/repo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ pub enum AmendFastOptions<'repo> {
449449
},
450450
}
451451

452-
impl<'repo> AmendFastOptions<'repo> {
452+
impl AmendFastOptions<'_> {
453453
/// Returns whether there are any paths to be amended.
454454
pub fn is_empty(&self) -> bool {
455455
match &self {

git-branchless-test/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ struct SearchGraph<'a> {
11641164
commit_set: CommitSet,
11651165
}
11661166

1167-
impl<'a> BasicSourceControlGraph for SearchGraph<'a> {
1167+
impl BasicSourceControlGraph for SearchGraph<'_> {
11681168
type Node = NonZeroOid;
11691169
type Error = SearchGraphError;
11701170

scm-bisect/src/search.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ impl<G: Graph> Search<G> {
265265
&'a self,
266266
strategy: &'a S,
267267
) -> Result<
268-
LazySolution<G::Node, SearchError<G::Node, G::Error, S::Error>>,
268+
LazySolution<'a, G::Node, SearchError<G::Node, G::Error, S::Error>>,
269269
SearchError<G::Node, G::Error, S::Error>,
270270
> {
271271
let success_bounds = self.success_bounds().map_err(SearchError::Graph)?;
@@ -284,7 +284,7 @@ impl<G: Graph> Search<G> {
284284
states: VecDeque<State<G>>,
285285
}
286286

287-
impl<'a, G: Graph, S: Strategy<G>> Iterator for Iter<'a, G, S> {
287+
impl<G: Graph, S: Strategy<G>> Iterator for Iter<'_, G, S> {
288288
type Item = Result<G::Node, SearchError<G::Node, G::Error, S::Error>>;
289289

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

0 commit comments

Comments
 (0)