From 92d15c3d9159fa292325e80c0e66eb1670bac5d0 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Tue, 31 Oct 2023 22:58:07 -0400 Subject: [PATCH] Fix clippy. --- src/types/ast_node.rs | 2 +- src/types/document.rs | 8 ++--- src/types/element.rs | 2 +- src/types/greater_element.rs | 24 +++++++------- src/types/lesser_element.rs | 32 +++++++++--------- src/types/object.rs | 56 ++++++++++++++++---------------- src/types/standard_properties.rs | 2 +- 7 files changed, 63 insertions(+), 63 deletions(-) diff --git a/src/types/ast_node.rs b/src/types/ast_node.rs index 8d40f13..e282b90 100644 --- a/src/types/ast_node.rs +++ b/src/types/ast_node.rs @@ -387,7 +387,7 @@ impl<'r, 's> StandardProperties<'s> for AstNode<'r, 's> { } } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { match self { AstNode::Document(inner) => inner.get_post_blank(), AstNode::Heading(inner) => inner.get_post_blank(), diff --git a/src/types/document.rs b/src/types/document.rs index 556dcec..e6f26ac 100644 --- a/src/types/document.rs +++ b/src/types/document.rs @@ -63,7 +63,7 @@ impl<'s> StandardProperties<'s> for Document<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -77,7 +77,7 @@ impl<'s> StandardProperties<'s> for Section<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -91,7 +91,7 @@ impl<'s> StandardProperties<'s> for Heading<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -159,7 +159,7 @@ impl<'s> StandardProperties<'s> for DocumentElement<'s> { } } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { match self { DocumentElement::Heading(inner) => inner.get_post_blank(), DocumentElement::Section(inner) => inner.get_post_blank(), diff --git a/src/types/element.rs b/src/types/element.rs index ebfe7da..b3a2ecb 100644 --- a/src/types/element.rs +++ b/src/types/element.rs @@ -113,7 +113,7 @@ impl<'s> StandardProperties<'s> for Element<'s> { } } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { match self { Element::Paragraph(inner) => inner.get_post_blank(), Element::PlainList(inner) => inner.get_post_blank(), diff --git a/src/types/greater_element.rs b/src/types/greater_element.rs index 6521e16..29572b7 100644 --- a/src/types/greater_element.rs +++ b/src/types/greater_element.rs @@ -137,7 +137,7 @@ impl<'s> StandardProperties<'s> for PlainList<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -151,7 +151,7 @@ impl<'s> StandardProperties<'s> for PlainListItem<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -165,7 +165,7 @@ impl<'s> StandardProperties<'s> for CenterBlock<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -179,7 +179,7 @@ impl<'s> StandardProperties<'s> for QuoteBlock<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -193,7 +193,7 @@ impl<'s> StandardProperties<'s> for SpecialBlock<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -207,7 +207,7 @@ impl<'s> StandardProperties<'s> for DynamicBlock<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -221,7 +221,7 @@ impl<'s> StandardProperties<'s> for FootnoteDefinition<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -235,7 +235,7 @@ impl<'s> StandardProperties<'s> for Drawer<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -249,7 +249,7 @@ impl<'s> StandardProperties<'s> for PropertyDrawer<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -263,7 +263,7 @@ impl<'s> StandardProperties<'s> for NodeProperty<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -277,7 +277,7 @@ impl<'s> StandardProperties<'s> for Table<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -291,7 +291,7 @@ impl<'s> StandardProperties<'s> for TableRow<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } diff --git a/src/types/lesser_element.rs b/src/types/lesser_element.rs index 71e9e70..c3ff018 100644 --- a/src/types/lesser_element.rs +++ b/src/types/lesser_element.rs @@ -204,7 +204,7 @@ impl<'s> StandardProperties<'s> for Paragraph<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -218,7 +218,7 @@ impl<'s> StandardProperties<'s> for TableCell<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -232,7 +232,7 @@ impl<'s> StandardProperties<'s> for Comment<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -246,7 +246,7 @@ impl<'s> StandardProperties<'s> for VerseBlock<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -259,7 +259,7 @@ impl<'s> StandardProperties<'s> for CommentBlock<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -272,7 +272,7 @@ impl<'s> StandardProperties<'s> for ExampleBlock<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -285,7 +285,7 @@ impl<'s> StandardProperties<'s> for ExportBlock<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -298,7 +298,7 @@ impl<'s> StandardProperties<'s> for SrcBlock<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -312,7 +312,7 @@ impl<'s> StandardProperties<'s> for Clock<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -326,7 +326,7 @@ impl<'s> StandardProperties<'s> for DiarySexp<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -340,7 +340,7 @@ impl<'s> StandardProperties<'s> for Planning<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -354,7 +354,7 @@ impl<'s> StandardProperties<'s> for FixedWidthArea<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -368,7 +368,7 @@ impl<'s> StandardProperties<'s> for HorizontalRule<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -382,7 +382,7 @@ impl<'s> StandardProperties<'s> for Keyword<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -396,7 +396,7 @@ impl<'s> StandardProperties<'s> for BabelCall<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -410,7 +410,7 @@ impl<'s> StandardProperties<'s> for LatexEnvironment<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } diff --git a/src/types/object.rs b/src/types/object.rs index b14f83b..de10ee5 100644 --- a/src/types/object.rs +++ b/src/types/object.rs @@ -526,7 +526,7 @@ impl<'s> StandardProperties<'s> for Bold<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -540,7 +540,7 @@ impl<'s> StandardProperties<'s> for Italic<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -554,7 +554,7 @@ impl<'s> StandardProperties<'s> for Underline<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -568,7 +568,7 @@ impl<'s> StandardProperties<'s> for StrikeThrough<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -582,7 +582,7 @@ impl<'s> StandardProperties<'s> for Code<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -596,7 +596,7 @@ impl<'s> StandardProperties<'s> for Verbatim<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -610,7 +610,7 @@ impl<'s> StandardProperties<'s> for RegularLink<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -624,7 +624,7 @@ impl<'s> StandardProperties<'s> for RadioLink<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -638,7 +638,7 @@ impl<'s> StandardProperties<'s> for RadioTarget<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -652,7 +652,7 @@ impl<'s> StandardProperties<'s> for PlainLink<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -666,7 +666,7 @@ impl<'s> StandardProperties<'s> for AngleLink<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -680,7 +680,7 @@ impl<'s> StandardProperties<'s> for OrgMacro<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -694,7 +694,7 @@ impl<'s> StandardProperties<'s> for Entity<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -708,7 +708,7 @@ impl<'s> StandardProperties<'s> for LatexFragment<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -722,7 +722,7 @@ impl<'s> StandardProperties<'s> for ExportSnippet<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -736,7 +736,7 @@ impl<'s> StandardProperties<'s> for FootnoteReference<'s> { self.contents } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { self.post_blank .map(|text| text.chars().count()) .unwrap_or(0) @@ -754,7 +754,7 @@ impl<'s> StandardProperties<'s> for Citation<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -768,7 +768,7 @@ impl<'s> StandardProperties<'s> for CitationReference<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -782,7 +782,7 @@ impl<'s> StandardProperties<'s> for InlineBabelCall<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -796,7 +796,7 @@ impl<'s> StandardProperties<'s> for InlineSourceBlock<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -810,7 +810,7 @@ impl<'s> StandardProperties<'s> for LineBreak<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -824,7 +824,7 @@ impl<'s> StandardProperties<'s> for Target<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -838,7 +838,7 @@ impl<'s> StandardProperties<'s> for StatisticsCookie<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -852,7 +852,7 @@ impl<'s> StandardProperties<'s> for Subscript<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -866,7 +866,7 @@ impl<'s> StandardProperties<'s> for Superscript<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -880,7 +880,7 @@ impl<'s> StandardProperties<'s> for Timestamp<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -894,7 +894,7 @@ impl<'s> StandardProperties<'s> for PlainText<'s> { todo!() } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { todo!() } } @@ -1055,7 +1055,7 @@ impl<'s> StandardProperties<'s> for Object<'s> { } } - fn get_post_blank<'b>(&'b self) -> PostBlank { + fn get_post_blank(&self) -> PostBlank { match self { Object::Bold(inner) => inner.get_post_blank(), Object::Italic(inner) => inner.get_post_blank(), diff --git a/src/types/standard_properties.rs b/src/types/standard_properties.rs index 9ec6b27..426e0f5 100644 --- a/src/types/standard_properties.rs +++ b/src/types/standard_properties.rs @@ -13,7 +13,7 @@ pub trait StandardProperties<'s> { /// Get the ast node's post-blank. /// /// For objects this is a count of the characters of whitespace after the object. For elements this is a count of the line breaks following an element. - fn get_post_blank<'b>(&'b self) -> PostBlank; + fn get_post_blank(&self) -> PostBlank; } // TODO: Write some debugging code to alert when any of the unknown fields below are non-nil in our test data so we can see what these fields represent.