Skip to content

Commit d8797fc

Browse files
committed
chore: clippies
1 parent a10ff8f commit d8797fc

File tree

4 files changed

+17
-19
lines changed

4 files changed

+17
-19
lines changed

acdc-parser/src/grammar/document.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,7 +1669,7 @@ peg::parser! {
16691669
rule cross_reference_shorthand_pattern() -> (String, Option<String>)
16701670
= "<<" target:$(['a'..='z' | 'A'..='Z' | '_'] ['a'..='z' | 'A'..='Z' | '0'..='9' | '_' | '-']*) content:("," text:$((!">>" [_])+) { text })? ">>"
16711671
{
1672-
(target.to_string(), content.map(|s| s.to_string()))
1672+
(target.to_string(), content.map(std::string::ToString::to_string))
16731673
}
16741674

16751675
/// Parse cross-reference macro syntax: xref:id[text]
@@ -1689,9 +1689,7 @@ peg::parser! {
16891689
/// Match cross-reference shorthand syntax without consuming: <<id>> or <<id,text>>
16901690
rule cross_reference_shorthand_match() -> ()
16911691
= cross_reference_shorthand_pattern()
1692-
{
1693-
()
1694-
}
1692+
{ }
16951693

16961694
/// Match cross-reference macro syntax without consuming: xref:id[text]
16971695
rule cross_reference_macro_match()

acdc-parser/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ use preprocessor::Preprocessor;
4848
pub use error::{Detail as ErrorDetail, Error};
4949
pub use model::{
5050
Admonition, AdmonitionVariant, Anchor, AttributeName, AttributeValue, Audio, Author, Autolink,
51-
Block, BlockMetadata, Bold, Button, CrossReference, CurvedApostrophe, CurvedQuotation, DelimitedBlock,
52-
DelimitedBlockType, DescriptionList, DescriptionListDescription, DescriptionListItem,
53-
DiscreteHeader, Document, DocumentAttribute, DocumentAttributes, ElementAttributes, Footnote,
54-
Form, Header, Highlight, Icon, Image, InlineMacro, InlineNode, Italic, Keyboard, LineBreak,
55-
Link, ListItem, ListItemCheckedStatus, Location, Menu, Monospace, OrderedList, PageBreak,
56-
Paragraph, Pass, PassthroughKind, Plain, Position, Raw, Role, Section, Source,
57-
StandaloneCurvedApostrophe, Subscript, Substitution, Superscript, Table, TableColumn,
51+
Block, BlockMetadata, Bold, Button, CrossReference, CurvedApostrophe, CurvedQuotation,
52+
DelimitedBlock, DelimitedBlockType, DescriptionList, DescriptionListDescription,
53+
DescriptionListItem, DiscreteHeader, Document, DocumentAttribute, DocumentAttributes,
54+
ElementAttributes, Footnote, Form, Header, Highlight, Icon, Image, InlineMacro, InlineNode,
55+
Italic, Keyboard, LineBreak, Link, ListItem, ListItemCheckedStatus, Location, Menu, Monospace,
56+
OrderedList, PageBreak, Paragraph, Pass, PassthroughKind, Plain, Position, Raw, Role, Section,
57+
Source, StandaloneCurvedApostrophe, Subscript, Substitution, Superscript, Table, TableColumn,
5858
TableOfContents, TableRow, ThematicBreak, UnorderedList, Url, Video,
5959
};
6060

acdc-parser/src/model/inlines/mod.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -463,11 +463,13 @@ impl<'de> Deserialize<'de> for InlineNode {
463463
("xref", "inline") => {
464464
let my_target =
465465
my_target.ok_or_else(|| de::Error::missing_field("target"))?;
466-
Ok(InlineNode::Macro(InlineMacro::CrossReference(crate::model::CrossReference {
467-
target: my_target.to_string(),
468-
text: my_text.map(|t| t.to_string()),
469-
location: my_location,
470-
})))
466+
Ok(InlineNode::Macro(InlineMacro::CrossReference(
467+
crate::model::CrossReference {
468+
target: my_target.to_string(),
469+
text: my_text.map(|t| t.to_string()),
470+
location: my_location,
471+
},
472+
)))
471473
}
472474
("ref", "inline") => {
473475
let my_variant =

converters/terminal/src/inline.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,7 @@ impl Render for CrossReference {
152152
fn render<W: Write>(&self, w: &mut W, _processor: &Processor) -> std::io::Result<()> {
153153
if let Some(text) = &self.text {
154154
// Render custom text with subtle styling to indicate it's a cross-reference
155-
w.queue(PrintStyledContent(
156-
text.clone().blue().underlined(),
157-
))?;
155+
w.queue(PrintStyledContent(text.clone().blue().underlined()))?;
158156
} else {
159157
// Render target in brackets with styling
160158
w.queue(PrintStyledContent(

0 commit comments

Comments
 (0)