Skip to content

Commit 04d8179

Browse files
committed
Dogfood
1 parent eba4143 commit 04d8179

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utils/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,14 +383,14 @@ fn trim_multiline_inner(s: Cow<str>, ignore_first: bool, ch: char) -> Cow<str> {
383383
let x = s.lines()
384384
.skip(ignore_first as usize)
385385
.filter_map(|l| {
386-
if l.len() > 0 {
386+
if l.is_empty() {
387+
None
388+
} else {
387389
// ignore empty lines
388390
Some(l.char_indices()
389391
.find(|&(_, x)| x != ch)
390392
.unwrap_or((l.len(), ch))
391393
.0)
392-
} else {
393-
None
394394
}
395395
})
396396
.min()
@@ -399,7 +399,7 @@ fn trim_multiline_inner(s: Cow<str>, ignore_first: bool, ch: char) -> Cow<str> {
399399
Cow::Owned(s.lines()
400400
.enumerate()
401401
.map(|(i, l)| {
402-
if (ignore_first && i == 0) || l.len() == 0 {
402+
if (ignore_first && i == 0) || l.is_empty() {
403403
l
404404
} else {
405405
l.split_at(x).1

0 commit comments

Comments
 (0)