Skip to content

Commit

Permalink
Appease clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
zesterer committed Jan 1, 2025
1 parent af507f6 commit 68147a2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,19 +283,19 @@ impl<'a, T> From<MaybeRef<'a, T>> for RichPattern<'a, T> {
}
}

impl<'a, T> From<&'static str> for RichPattern<'a, T> {
impl<T> From<&'static str> for RichPattern<'_, T> {
fn from(label: &'static str) -> Self {
Self::Label(Cow::Borrowed(label))
}
}

impl<'a, T> From<String> for RichPattern<'a, T> {
impl<T> From<String> for RichPattern<'_, T> {
fn from(label: String) -> Self {
Self::Label(Cow::Owned(label))
}
}

impl<'a> From<char> for RichPattern<'a, char> {
impl From<char> for RichPattern<'_, char> {
fn from(c: char) -> Self {
Self::Token(MaybeRef::Val(c))
}
Expand Down
6 changes: 3 additions & 3 deletions src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,7 @@ impl<'src, 'parse, I: Input<'src>, E: ParserExtra<'src, I>> InputRef<'src, 'pars
I: ValueInput<'src>,
{
// SAFETY: cursor was generated by previous call to `Input::next`
unsafe { I::next(self.cache, &mut self.cursor.clone()).map(Into::into) }
unsafe { I::next(self.cache, &mut self.cursor.clone()) }
}

/// Peek the next token in the input. Returns `None` if the end of the input has been reached.
Expand All @@ -1551,7 +1551,7 @@ impl<'src, 'parse, I: Input<'src>, E: ParserExtra<'src, I>> InputRef<'src, 'pars
I: BorrowInput<'src>,
{
// SAFETY: cursor was generated by previous call to `Input::next`
unsafe { I::next_ref(self.cache, &mut self.cursor.clone()).map(Into::into) }
unsafe { I::next_ref(self.cache, &mut self.cursor.clone()) }
}

/// Skip the next token in the input.
Expand Down Expand Up @@ -1681,7 +1681,7 @@ impl<'src, 'parse, I: Input<'src>, E: ParserExtra<'src, I>> InputRef<'src, 'pars

// Prioritize errors before choosing whether to generate the alt (avoids unnecessary error creation)
self.errors.alt = Some(match self.errors.alt.take() {
Some(alt) => match { I::cursor_location(&alt.pos).cmp(&I::cursor_location(at)) } {
Some(alt) => match I::cursor_location(&alt.pos).cmp(&I::cursor_location(at)) {
Ordering::Equal => {
Located::at(alt.pos, alt.err.merge_expected_found(expected, found, span))
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ pub enum DefaultExpected<'a, T> {
EndOfInput,
}

impl<'a, T> DefaultExpected<'a, T> {
impl<T> DefaultExpected<'_, T> {
/// Convert this [`DefaultExpected`] into an owned version of itself, cloning any inner references if required.
#[inline]
pub fn into_owned(self) -> DefaultExpected<'static, T>
Expand Down Expand Up @@ -3644,7 +3644,7 @@ mod tests {
LabelError::<&str, char>::expected_found(
['n'],
e.found().map(|i| From::from(*i)),
e.span().clone(),
*e.span(),
)
}))
.ignored()
Expand Down

0 comments on commit 68147a2

Please sign in to comment.