mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
refactor(embedded): Name the steps when trimming
This commit is contained in:
parent
544013e786
commit
a00d0bade5
@ -150,13 +150,12 @@ impl<'s> ScriptSource<'s> {
|
|||||||
|
|
||||||
let mut rest = source.content;
|
let mut rest = source.content;
|
||||||
while !rest.is_empty() {
|
while !rest.is_empty() {
|
||||||
let c = rest;
|
let without_spaces = rest.trim_start_matches([' ', '\t']);
|
||||||
let c = c.trim_start_matches([' ', '\t']);
|
let without_nl = without_spaces.trim_start_matches(['\r', '\n']);
|
||||||
let c = c.trim_start_matches(['\r', '\n']);
|
if without_nl == rest {
|
||||||
if c == rest {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
rest = c;
|
rest = without_nl;
|
||||||
}
|
}
|
||||||
let fence_end = rest
|
let fence_end = rest
|
||||||
.char_indices()
|
.char_indices()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user