Skip to content

Commit

Permalink
Remove unused lifetimes to address clippy lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
emmiegit committed Dec 15, 2024
1 parent faf9d53 commit d2bbeff
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/data/backlinks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct Backlinks<'a> {
pub external_links: Vec<Cow<'a, str>>,
}

impl<'a> Backlinks<'a> {
impl Backlinks<'_> {
#[inline]
pub fn new() -> Self {
Backlinks::default()
Expand Down
4 changes: 2 additions & 2 deletions src/parsing/parser_wrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ impl<'p, 'r, 't> ParserWrap<'p, 'r, 't> {
}
}

impl<'p, 'r, 't> Deref for ParserWrap<'p, 'r, 't> {
impl<'r, 't> Deref for ParserWrap<'_, 'r, 't> {
type Target = Parser<'r, 't>;

fn deref(&self) -> &Parser<'r, 't> {
self.parser
}
}

impl<'p, 'r, 't> DerefMut for ParserWrap<'p, 'r, 't> {
impl<'r, 't> DerefMut for ParserWrap<'_, 'r, 't> {
fn deref_mut(&mut self) -> &mut Parser<'r, 't> {
self.parser
}
Expand Down
6 changes: 3 additions & 3 deletions src/parsing/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ where
_text_marker: PhantomData<&'t str>,
}

impl<'r, 't, T> ParseSuccess<'r, 't, T> {
impl<T> ParseSuccess<'_, '_, T> {
#[inline]
pub fn new(item: T, errors: Vec<ParseError>, paragraph_safe: bool) -> Self {
ParseSuccess {
Expand Down Expand Up @@ -111,7 +111,7 @@ impl<'r, 't, T> ParseSuccess<'r, 't, T> {
}
}

impl<'r, 't> ParseSuccess<'r, 't, Elements<'t>> {
impl<'t> ParseSuccess<'_, 't, Elements<'t>> {
pub fn check_partials(&self, parser: &Parser) -> Result<(), ParseError> {
for element in &self.item {
// This check only applies if the element is a partial.
Expand All @@ -128,7 +128,7 @@ impl<'r, 't> ParseSuccess<'r, 't, Elements<'t>> {
}
}

impl<'r, 't> ParseSuccess<'r, 't, ()> {
impl ParseSuccess<'_, '_, ()> {
#[inline]
pub fn into_errors(self) -> Vec<ParseError> {
self.errors
Expand Down
2 changes: 1 addition & 1 deletion src/parsing/token/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub struct ExtractedToken<'a> {
pub span: Range<usize>,
}

impl<'a> ExtractedToken<'a> {
impl ExtractedToken<'_> {
/// Returns a new object with the same values, except with span refering to the byte indicies
/// of the text if it were in UTF-16 rather than in UTF-8.
#[must_use]
Expand Down
2 changes: 1 addition & 1 deletion src/render/html/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ impl<'c, 'i, 'h, 'e, 't> HtmlBuilderTag<'c, 'i, 'h, 'e, 't> {
}
}

impl<'c, 'i, 'h, 'e, 't> Drop for HtmlBuilderTag<'c, 'i, 'h, 'e, 't> {
impl Drop for HtmlBuilderTag<'_, '_, '_, '_, '_> {
fn drop(&mut self) {
if self.in_tag && !self.in_contents {
self.ctx.push_raw('>');
Expand Down
4 changes: 2 additions & 2 deletions src/render/html/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,14 @@ impl<'i, 'h, 'e, 't> From<HtmlContext<'i, 'h, 'e, 't>> for HtmlOutput {
}
}

impl<'i, 'h, 'e, 't> Write for HtmlContext<'i, 'h, 'e, 't> {
impl Write for HtmlContext<'_, '_, '_, '_> {
#[inline]
fn write_str(&mut self, s: &str) -> fmt::Result {
self.buffer().write_str(s)
}
}

impl<'i, 'h, 'e, 't> NextIndex<TableOfContentsIndex> for HtmlContext<'i, 'h, 'e, 't> {
impl NextIndex<TableOfContentsIndex> for HtmlContext<'_, '_, '_, '_> {
#[inline]
fn next(&mut self) -> usize {
self.next_table_of_contents_index()
Expand Down
2 changes: 1 addition & 1 deletion src/render/text/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ impl<'i, 'h, 'e, 't> From<TextContext<'i, 'h, 'e, 't>> for String {
}
}

impl<'i, 'h, 'e, 't> Write for TextContext<'i, 'h, 'e, 't>
impl<'e, 't> Write for TextContext<'_, '_, 'e, 't>
where
'e: 't,
{
Expand Down
2 changes: 1 addition & 1 deletion src/tree/attribute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ impl<'t> AttributeMap<'t> {
}
}

impl<'t> Debug for AttributeMap<'t> {
impl Debug for AttributeMap<'_> {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
self.inner.fmt(f)
Expand Down
2 changes: 1 addition & 1 deletion src/tree/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct CodeBlock<'t> {
pub name: Option<Cow<'t, str>>,
}

impl<'t> CodeBlock<'t> {
impl CodeBlock<'_> {
pub fn to_owned(&self) -> CodeBlock<'static> {
CodeBlock {
contents: string_to_owned(&self.contents),
Expand Down

0 comments on commit d2bbeff

Please sign in to comment.