Skip to content

Commit b29cb17

Browse files
committed
chore: fix clippy warnings
1 parent fe05e56 commit b29cb17

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

pomsky-bin/src/format.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ impl Logger {
4747
}
4848
}
4949

50-
pub(crate) fn basic(&self) -> Formatted<FormatBasic> {
50+
pub(crate) fn basic(&self) -> Formatted<'_, FormatBasic> {
5151
Formatted { format: FormatBasic, logger: self }
5252
}
5353

5454
pub(crate) fn diagnostic<'a>(
5555
&self,
5656
severity: Severity,
5757
kind: &'a str,
58-
) -> Formatted<FormatDetailed<'a, 4>> {
58+
) -> Formatted<'_, FormatDetailed<'a, 4>> {
5959
let label = match severity {
6060
Severity::Error => Segment { style: Some(Style::R), text: "error", ticks: false },
6161
Severity::Warning => Segment { style: Some(Style::Y), text: "warning", ticks: false },
@@ -69,7 +69,7 @@ impl Logger {
6969
severity: Severity,
7070
code: &'a str,
7171
kind: &'a str,
72-
) -> Formatted<FormatDetailed<'a, 5>> {
72+
) -> Formatted<'_, FormatDetailed<'a, 5>> {
7373
let label = match severity {
7474
Severity::Error => Segment { style: Some(Style::R), text: "error ", ticks: false },
7575
Severity::Warning => Segment { style: Some(Style::Y), text: "warning ", ticks: false },
@@ -84,15 +84,15 @@ impl Logger {
8484
Formatted { format: FormatDetailed { start }, logger: self }
8585
}
8686

87-
pub(crate) fn error(&self) -> Formatted<FormatError> {
87+
pub(crate) fn error(&self) -> Formatted<'_, FormatError> {
8888
Formatted { format: FormatError, logger: self }
8989
}
9090

91-
pub(crate) fn warn(&self) -> Formatted<FormatWarning> {
91+
pub(crate) fn warn(&self) -> Formatted<'_, FormatWarning> {
9292
Formatted { format: FormatWarning, logger: self }
9393
}
9494

95-
pub(crate) fn note(&self) -> Formatted<FormatNote> {
95+
pub(crate) fn note(&self) -> Formatted<'_, FormatNote> {
9696
Formatted { format: FormatNote, logger: self }
9797
}
9898
}

pomsky-syntax/src/parse/parser_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ impl<'i> Parser<'i> {
568568
return Err(PEK::UnallowedNot.at(nots_span));
569569
}
570570
group
571-
} else if let Some(group) = self.parse_char_group_ident(nots % 2 != 0)? {
571+
} else if let Some(group) = self.parse_char_group_ident(!nots.is_multiple_of(2))? {
572572
if nots > 1 {
573573
return Err(PEK::UnallowedMultiNot(nots).at(nots_span));
574574
}

pomsky-syntax/src/pretty_print.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ impl PrettyPrinter {
1515
}
1616

1717
fn add_spaces(&mut self, n: usize) {
18-
self.buf.extend(std::iter::repeat(' ').take(n));
18+
self.buf.extend(std::iter::repeat_n(' ', n));
1919
}
2020

2121
pub(crate) fn write(&mut self, s: &str) {
@@ -63,14 +63,14 @@ impl PrettyPrinter {
6363
self.buf.push_str(paren);
6464
self.indent += 2;
6565
self.buf.push('\n');
66-
self.buf.extend(std::iter::repeat(' ').take(self.indent));
66+
self.buf.extend(std::iter::repeat_n(' ', self.indent));
6767
}
6868

6969
pub(crate) fn end_indentation(&mut self, paren: &str) {
7070
debug_assert!(!paren.contains('\n'));
7171
self.indent = self.indent.saturating_sub(2);
7272
self.buf.push('\n');
73-
self.buf.extend(std::iter::repeat(' ').take(self.indent));
73+
self.buf.extend(std::iter::repeat_n(' ', self.indent));
7474
self.buf.push_str(paren);
7575
}
7676

0 commit comments

Comments
 (0)