Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused lifetimes to address clippy lint. #27

Merged
merged 1 commit into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading