This commit is contained in:
Richard Feldman 2022-10-31 08:04:28 -04:00
parent eaa0824347
commit e9e4e710e2
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B
2 changed files with 8 additions and 10 deletions

View file

@ -132,7 +132,7 @@ pub fn expect_success(input: &str, expected: &str) {
// The state.rs tests do that!
let mut iter = out.stdout.lines().rev();
let line = iter.next().unwrap();
let comment_index = line.rfind("#").unwrap_or_else(|| line.len());
let comment_index = line.rfind('#').unwrap_or(line.len());
let line_without_comment = line[0..comment_index].trim_end();
// Sometimes the "# val1" wraps around to its own line; if this happens,