Skip to content

Commit

Permalink
cleanup: fix latest nightly lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
arxanas committed Dec 2, 2024
1 parent b5a6bfd commit 4275c65
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion git-branchless-lib/src/core/effects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ impl Drop for ProgressHandle<'_> {
}
}

impl<'a> ProgressHandle<'a> {
impl ProgressHandle<'_> {
/// Notify the progress meter that the current operation has `total`
/// discrete units of work, and it's currently `current` units of the way
/// through the operation.
Expand Down
10 changes: 5 additions & 5 deletions git-branchless-lib/src/core/node_descriptors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub enum NodeObject<'repo> {
},
}

impl<'repo> NodeObject<'repo> {
impl NodeObject<'_> {
fn get_oid(&self) -> NonZeroOid {
match self {
NodeObject::Commit { commit } => commit.get_oid(),
Expand Down Expand Up @@ -214,7 +214,7 @@ impl<'a> CommitMessageDescriptor<'a> {
}
}

impl<'a> NodeDescriptor for CommitMessageDescriptor<'a> {
impl NodeDescriptor for CommitMessageDescriptor<'_> {
#[instrument]
fn describe_node(
&mut self,
Expand Down Expand Up @@ -249,7 +249,7 @@ impl<'a> ObsolescenceExplanationDescriptor<'a> {
}
}

impl<'a> NodeDescriptor for ObsolescenceExplanationDescriptor<'a> {
impl NodeDescriptor for ObsolescenceExplanationDescriptor<'_> {
fn describe_node(
&mut self,
_glyphs: &Glyphs,
Expand Down Expand Up @@ -317,7 +317,7 @@ impl<'a> BranchesDescriptor<'a> {
}
}

impl<'a> NodeDescriptor for BranchesDescriptor<'a> {
impl NodeDescriptor for BranchesDescriptor<'_> {
#[instrument]
fn describe_node(
&mut self,
Expand Down Expand Up @@ -412,7 +412,7 @@ $",
Some(diff_number.to_owned())
}

impl<'a> NodeDescriptor for DifferentialRevisionDescriptor<'a> {
impl NodeDescriptor for DifferentialRevisionDescriptor<'_> {
#[instrument]
fn describe_node(
&mut self,
Expand Down
6 changes: 1 addition & 5 deletions git-branchless-lib/src/core/rewrite/evolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ pub fn find_rewrite_target(
event_cursor: EventCursor,
oid: NonZeroOid,
) -> Option<MaybeZeroOid> {
let event = event_replayer.get_cursor_commit_latest_event(event_cursor, oid);
let event = match event {
Some(event) => event,
None => return None,
};
let event = event_replayer.get_cursor_commit_latest_event(event_cursor, oid)?;
match event {
Event::RewriteEvent {
timestamp: _,
Expand Down
4 changes: 2 additions & 2 deletions git-branchless-lib/src/core/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub struct ResourceHandle<'pool, R: Resource> {
inner: Option<R::Output>,
}

impl<'a, R: Resource> Drop for ResourceHandle<'a, R> {
impl<R: Resource> Drop for ResourceHandle<'_, R> {
fn drop(&mut self) {
let mut resources = self
.parent
Expand All @@ -97,7 +97,7 @@ impl<'a, R: Resource> Drop for ResourceHandle<'a, R> {
}
}

impl<'a, R: Resource> Deref for ResourceHandle<'a, R> {
impl<R: Resource> Deref for ResourceHandle<'_, R> {
type Target = R::Output;

fn deref(&self) -> &Self::Target {
Expand Down
2 changes: 1 addition & 1 deletion git-branchless-lib/src/git/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ pub struct Blob<'repo> {
pub(super) inner: git2::Blob<'repo>,
}

impl<'repo> Blob<'repo> {
impl Blob<'_> {
/// Get the size of the blob in bytes.
pub fn size(&self) -> u64 {
self.inner.size().try_into().unwrap()
Expand Down
2 changes: 1 addition & 1 deletion git-branchless-lib/src/git/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ pub enum AmendFastOptions<'repo> {
},
}

impl<'repo> AmendFastOptions<'repo> {
impl AmendFastOptions<'_> {
/// Returns whether there are any paths to be amended.
pub fn is_empty(&self) -> bool {
match &self {
Expand Down
2 changes: 1 addition & 1 deletion git-branchless-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ struct SearchGraph<'a> {
commit_set: CommitSet,
}

impl<'a> BasicSourceControlGraph for SearchGraph<'a> {
impl BasicSourceControlGraph for SearchGraph<'_> {
type Node = NonZeroOid;
type Error = SearchGraphError;

Expand Down
4 changes: 2 additions & 2 deletions scm-bisect/src/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ impl<G: Graph> Search<G> {
&'a self,
strategy: &'a S,
) -> Result<
LazySolution<G::Node, SearchError<G::Node, G::Error, S::Error>>,
LazySolution<'a, G::Node, SearchError<G::Node, G::Error, S::Error>>,
SearchError<G::Node, G::Error, S::Error>,
> {
let success_bounds = self.success_bounds().map_err(SearchError::Graph)?;
Expand All @@ -284,7 +284,7 @@ impl<G: Graph> Search<G> {
states: VecDeque<State<G>>,
}

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

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

0 comments on commit 4275c65

Please sign in to comment.