Skip to content
This repository was archived by the owner on Nov 15, 2025. It is now read-only.

Commit b2ab4b6

Browse files
committed
Fix clippy lint.
1 parent b0ab960 commit b2ab4b6

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/formatter.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -433,15 +433,17 @@ impl Formatter {
433433
found_comment = true;
434434

435435
// Remove everything until this comment.
436-
let mut additional_chars_to_remove =
437-
line_before_chars_count - skipped_chars_count;
438436
#[cfg(windows)]
439437
{
440-
// also consider `\r`
441-
additional_chars_to_remove =
442-
additional_chars_to_remove.saturating_sub(1);
438+
// `-1` to also consider `\r`
439+
chars_to_remove +=
440+
line_before_chars_count - skipped_chars_count - 1;
441+
}
442+
#[cfg(not(windows))]
443+
{
444+
chars_to_remove +=
445+
line_before_chars_count - skipped_chars_count;
443446
}
444-
chars_to_remove += additional_chars_to_remove;
445447

446448
// Also remove empty text before this comment.
447449
chars_to_remove += last_empty_chars_count.saturating_sub(1);

src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![deny(warnings)]
2+
13
use config::Config;
24
use formatter::Formatter;
35
use std::io::Write;

0 commit comments

Comments
 (0)