Skip to content

Commit 03514a6

Browse files
committed
refactor(tests): use lazy evaluation on error message
1 parent 3dfb7cd commit 03514a6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/uri/path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,6 @@ mod tests {
671671
}
672672

673673
fn pq(s: &str) -> PathAndQuery {
674-
s.parse().expect(&format!("parsing {}", s))
674+
s.parse().unwrap_or_else(|_| panic!("parsing {s}"))
675675
}
676676
}

src/uri/scheme.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,6 @@ mod test {
356356
}
357357

358358
fn scheme(s: &str) -> Scheme {
359-
s.parse().expect(&format!("Invalid scheme: {}", s))
359+
s.parse().unwrap_or_else(|_| panic!("Invalid scheme: {s}"))
360360
}
361361
}

0 commit comments

Comments
 (0)