Skip to content

Commit

Permalink
clippy: make lifetimes anonymous where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
apoelstra committed Jan 11, 2025
1 parent fbe88d6 commit 01da7e5
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/bit_encoding/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ enum DecodeNode<J: Jet> {
Word(Word),
}

impl<'d, J: Jet> DagLike for (usize, &'d [DecodeNode<J>]) {
impl<J: Jet> DagLike for (usize, &'_ [DecodeNode<J>]) {
type Node = DecodeNode<J>;

fn data(&self) -> &DecodeNode<J> {
Expand Down
4 changes: 2 additions & 2 deletions src/bit_encoding/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl<'n, N: node::Marker> Disconnectable<EncodeNode<'n, N>> for EncodeNode<'n, N
}
}

impl<'n, N: node::Marker> DagLike for EncodeNode<'n, N> {
impl<N: node::Marker> DagLike for EncodeNode<'_, N> {
type Node = Self;
fn data(&self) -> &Self {
self
Expand Down Expand Up @@ -125,7 +125,7 @@ impl<N: node::Marker> Default for EncodeSharing<N> {
}
}

impl<'n, N: node::Marker> SharingTracker<EncodeNode<'n, N>> for EncodeSharing<N> {
impl<N: node::Marker> SharingTracker<EncodeNode<'_, N>> for EncodeSharing<N> {
fn record(&mut self, d: &EncodeNode<N>, index: usize) -> Option<usize> {
let id = match d {
EncodeNode::Node(n) => EncodeId::Node(n.sharing_id()?),
Expand Down
2 changes: 1 addition & 1 deletion src/bit_machine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ impl BitMachine {
}

// Not used, but useful for debugging, so keep it around
impl<'a, J: Jet> fmt::Debug for CallStack<'a, J> {
impl<J: Jet> fmt::Debug for CallStack<'_, J> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
CallStack::Goto(ins) => write!(f, "goto {}", ins.inner()),
Expand Down
2 changes: 1 addition & 1 deletion src/dag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ impl<D: DagLike> DagLike for SwapChildren<D> {
}
}

impl<'a, N: node::Marker> DagLike for &'a Node<N> {
impl<N: node::Marker> DagLike for &'_ Node<N> {
type Node = Node<N>;

fn data(&self) -> &Node<N> {
Expand Down
2 changes: 1 addition & 1 deletion src/human_encoding/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl WitnessOrHole {
}
}

impl<'a> From<&'a NoWitness> for WitnessOrHole {
impl From<&'_ NoWitness> for WitnessOrHole {
fn from(_: &NoWitness) -> Self {
WitnessOrHole::Witness
}
Expand Down
2 changes: 1 addition & 1 deletion src/human_encoding/named_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl<J: Jet> NamedCommitNode<J> {
phantom: PhantomData<J>,
}

impl<'a, J: Jet> Converter<Named<Commit<J>>, Witness<J>> for Populator<'a, J> {
impl<J: Jet> Converter<Named<Commit<J>>, Witness<J>> for Populator<'_, J> {
type Error = ();

fn convert_witness(
Expand Down
2 changes: 1 addition & 1 deletion src/human_encoding/parse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ struct ResolvedExpression<J: Jet> {
in_degree: AtomicUsize,
}

impl<'a, J: Jet> DagLike for &'a ResolvedExpression<J> {
impl<J: Jet> DagLike for &'_ ResolvedExpression<J> {
type Node = ResolvedExpression<J>;
fn data(&self) -> &ResolvedExpression<J> {
self
Expand Down
4 changes: 2 additions & 2 deletions src/node/redeem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ impl<J: Jet> RedeemNode<J> {
phantom: PhantomData<J>,
}

impl<'bits, J: Jet, I: Iterator<Item = u8>> Converter<Construct<J>, Redeem<J>>
for DecodeFinalizer<'bits, J, I>
impl<J: Jet, I: Iterator<Item = u8>> Converter<Construct<J>, Redeem<J>>
for DecodeFinalizer<'_, J, I>
{
type Error = Error;
fn convert_witness(
Expand Down
4 changes: 2 additions & 2 deletions src/types/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ impl super::PointerLike for BoundRef {
}
}

impl<'ctx> DagLike for (&'ctx Context, BoundRef) {
impl DagLike for (&'_ Context, BoundRef) {
type Node = BoundRef;
fn data(&self) -> &BoundRef {
&self.1
Expand Down Expand Up @@ -318,7 +318,7 @@ struct LockedContext<'ctx> {
slab: MutexGuard<'ctx, Vec<Bound>>,
}

impl<'ctx> LockedContext<'ctx> {
impl LockedContext<'_> {
fn alloc_bound(&mut self, bound: Bound) -> BoundRef {
self.slab.push(bound);
let index = self.slab.len() - 1;
Expand Down
2 changes: 1 addition & 1 deletion src/types/final_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl fmt::Display for Final {
}
}

impl<'a> DagLike for &'a Final {
impl DagLike for &'_ Final {
type Node = Final;
fn data(&self) -> &Final {
self
Expand Down
4 changes: 2 additions & 2 deletions src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ enum ValueInner {
Product(Arc<Value>, Arc<Value>),
}

impl<'a> DagLike for &'a Value {
impl DagLike for &'_ Value {
type Node = Value;

fn data(&self) -> &Value {
Expand Down Expand Up @@ -361,7 +361,7 @@ impl<'a> PaddedBitsIter<'a> {
}
}

impl<'a> Iterator for PaddedBitsIter<'a> {
impl Iterator for PaddedBitsIter<'_> {
type Item = bool;

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

0 comments on commit 01da7e5

Please sign in to comment.