Update crates/expect/src/lib.rs

Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
This commit is contained in:
Aleksey Kladov 2020-06-27 20:45:04 +02:00
parent d21dae738b
commit 18e4e9fb0b

View file

@ -78,7 +78,7 @@ impl Expect {
line_start += line.len();
}
let (literal_start, line_indent) = target_line.unwrap();
let literal_length = file[literal_start..].find("]]").unwrap();
let literal_length = file[literal_start..].find("]]").expect("Couldn't find matching `]]` for `expect![[`.");
let literal_range = literal_start..literal_start + literal_length;
Location { line_indent, literal_range }
}