Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions pest/src/iterators/pairs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,10 +608,10 @@ mod tests {
assert_eq!(
format!("{:?}", pairs),
"[\
Pair { rule: a, span: Span { str: \"abc\", start: 0, end: 3 }, inner: [\
Pair { rule: b, span: Span { str: \"b\", start: 1, end: 2 }, inner: [] }\
Pair { rule: a, span: Span { str: \"abc\", range: 0..3 }, inner: [\
Pair { rule: b, span: Span { str: \"b\", range: 1..2 }, inner: [] }\
] }, \
Pair { rule: c, span: Span { str: \"e\", start: 4, end: 5 }, inner: [] }\
Pair { rule: c, span: Span { str: \"e\", range: 4..5 }, inner: [] }\
]"
.to_owned()
);
Expand Down
6 changes: 3 additions & 3 deletions pest/src/span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,12 @@ impl<'i> Span<'i> {
}
}

impl fmt::Debug for Span<'_> {
impl<'i> fmt::Debug for Span<'i> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the explicit lifetime needed? The clippy issue shows the original code before the change was ok / it can be elided: https://github.com/pest-parser/pest/actions/runs/20941202000/job/60191732029?pr=1148#step:5:229

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can change it to be that way. clippy was just yelling at me, that's all.
clippy 0.1.91 (9c27f27ea3 2025-09-08)

fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let range = self.start..self.end;
f.debug_struct("Span")
.field("str", &self.as_str())
.field("start", &self.start)
.field("end", &self.end)
.field("range", &range)
.finish()
}
}
Expand Down
Loading