Skip to content

Commit 090f289

Browse files
committed
make an expect into proper error reporting
1 parent 1c85975 commit 090f289

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ui_test/src/parser.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ impl Condition {
6969
if c == "on-host" {
7070
Ok(Condition::OnHost)
7171
} else if let Some(bits) = c.strip_suffix("bit") {
72-
let bits: u8 = bits.parse().expect(
73-
"ignore/only filter ending in 'bit' must be of the form 'Nbit' for some integer N",
74-
);
72+
let bits: u8 = bits.parse().map_err(|_err| {
73+
eyre!("invalid ignore/only filter ending in 'bit': {c:?} is not a valid bitwdith")
74+
})?;
7575
Ok(Condition::Bitwidth(bits))
7676
} else if let Some(target) = c.strip_prefix("target-") {
7777
Ok(Condition::Target(target.to_owned()))

0 commit comments

Comments
 (0)