From d2bbeff5dca3cb1c475312a8a464ea832c159af4 Mon Sep 17 00:00:00 2001 From: Emmie Maeda Date: Sun, 15 Dec 2024 04:40:25 -0500 Subject: [PATCH] Remove unused lifetimes to address clippy lint. --- src/data/backlinks.rs | 2 +- src/parsing/parser_wrap.rs | 4 ++-- src/parsing/result.rs | 6 +++--- src/parsing/token/mod.rs | 2 +- src/render/html/builder.rs | 2 +- src/render/html/context.rs | 4 ++-- src/render/text/context.rs | 2 +- src/tree/attribute/mod.rs | 2 +- src/tree/code.rs | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/data/backlinks.rs b/src/data/backlinks.rs index f1fdf3bee..012e0a305 100644 --- a/src/data/backlinks.rs +++ b/src/data/backlinks.rs @@ -29,7 +29,7 @@ pub struct Backlinks<'a> { pub external_links: Vec>, } -impl<'a> Backlinks<'a> { +impl Backlinks<'_> { #[inline] pub fn new() -> Self { Backlinks::default() diff --git a/src/parsing/parser_wrap.rs b/src/parsing/parser_wrap.rs index c9a5158fe..a07c7a45b 100644 --- a/src/parsing/parser_wrap.rs +++ b/src/parsing/parser_wrap.rs @@ -42,7 +42,7 @@ 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> { @@ -50,7 +50,7 @@ impl<'p, 'r, 't> Deref for ParserWrap<'p, 'r, 't> { } } -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 } diff --git a/src/parsing/result.rs b/src/parsing/result.rs index a93a0cbeb..aa14b0ea9 100644 --- a/src/parsing/result.rs +++ b/src/parsing/result.rs @@ -44,7 +44,7 @@ where _text_marker: PhantomData<&'t str>, } -impl<'r, 't, T> ParseSuccess<'r, 't, T> { +impl ParseSuccess<'_, '_, T> { #[inline] pub fn new(item: T, errors: Vec, paragraph_safe: bool) -> Self { ParseSuccess { @@ -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. @@ -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 { self.errors diff --git a/src/parsing/token/mod.rs b/src/parsing/token/mod.rs index 64fdce3b5..d4d8e2d38 100644 --- a/src/parsing/token/mod.rs +++ b/src/parsing/token/mod.rs @@ -46,7 +46,7 @@ pub struct ExtractedToken<'a> { pub span: Range, } -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] diff --git a/src/render/html/builder.rs b/src/render/html/builder.rs index 1aa5609f7..7e3e04020 100644 --- a/src/render/html/builder.rs +++ b/src/render/html/builder.rs @@ -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('>'); diff --git a/src/render/html/context.rs b/src/render/html/context.rs index 4e05e76a8..eaccd3daa 100644 --- a/src/render/html/context.rs +++ b/src/render/html/context.rs @@ -352,14 +352,14 @@ impl<'i, 'h, 'e, 't> From> 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 for HtmlContext<'i, 'h, 'e, 't> { +impl NextIndex for HtmlContext<'_, '_, '_, '_> { #[inline] fn next(&mut self) -> usize { self.next_table_of_contents_index() diff --git a/src/render/text/context.rs b/src/render/text/context.rs index 81ebfbed6..85d2e85c4 100644 --- a/src/render/text/context.rs +++ b/src/render/text/context.rs @@ -260,7 +260,7 @@ impl<'i, 'h, 'e, 't> From> 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, { diff --git a/src/tree/attribute/mod.rs b/src/tree/attribute/mod.rs index a80bc2ca3..145323f42 100644 --- a/src/tree/attribute/mod.rs +++ b/src/tree/attribute/mod.rs @@ -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) diff --git a/src/tree/code.rs b/src/tree/code.rs index 2af65bd2b..71861f877 100644 --- a/src/tree/code.rs +++ b/src/tree/code.rs @@ -29,7 +29,7 @@ pub struct CodeBlock<'t> { pub name: Option>, } -impl<'t> CodeBlock<'t> { +impl CodeBlock<'_> { pub fn to_owned(&self) -> CodeBlock<'static> { CodeBlock { contents: string_to_owned(&self.contents),