Skip to content

Commit 18bdbcf

Browse files
committed
refactor(tests): use lazy evaluation on error message
1 parent ad1d3c7 commit 18bdbcf

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
@@ -599,6 +599,6 @@ mod tests {
599599
}
600600

601601
fn pq(s: &str) -> PathAndQuery {
602-
s.parse().expect(&format!("parsing {}", s))
602+
s.parse().unwrap_or_else(|_| panic!("parsing {s}"))
603603
}
604604
}

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)