1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-15 09:41:07 +00:00

nl: fix clippy error

This commit is contained in:
Jeong YunWon 2021-06-11 14:24:17 +09:00
parent 3ea18173cb
commit e45f5404db

View file

@ -247,7 +247,7 @@ fn nl<T: Read>(reader: &mut BufReader<T>, settings: &Settings) {
let mut line_filter: fn(&str, &regex::Regex) -> bool = pass_regex;
for mut l in reader.lines().map(|r| r.unwrap()) {
// Sanitize the string. We want to print the newline ourselves.
if l.chars().last() == Some('\n') {
if l.ends_with('\n') {
l.pop();
}
// Next we iterate through the individual chars to see if this