Skip to content

Commit

Permalink
fix: Fix lifetime specifier for nightly (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
oblique committed Jul 24, 2024
1 parent a271ac6 commit a15fc29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/simple_merkle/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ use crate::maybestd::{boxed::Box, fmt::Debug, hash::Hash, ops::Range, vec::Vec};
/// Manually implement the method we need from #[feature(slice_take)] to
/// allow building with stable;
trait TakeLast<T> {
fn slice_take_last(self: &mut &Self) -> Option<&T>;
fn slice_take_last<'a>(self: &mut &'a Self) -> Option<&'a T>;
}

impl<T> TakeLast<T> for [T] {
fn slice_take_last(self: &mut &Self) -> Option<&T> {
fn slice_take_last<'a>(self: &mut &'a Self) -> Option<&'a T> {
let (last, rem) = self.split_last()?;
*self = rem;
Some(last)
Expand Down

0 comments on commit a15fc29

Please sign in to comment.