Skip to content

Commit

Permalink
panic on invalid format
Browse files Browse the repository at this point in the history
Signed-off-by: Runji Wang <[email protected]>
  • Loading branch information
wangrunji0408 committed Jul 5, 2023
1 parent 464eaea commit 136e7dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion madsim-tonic/src/sim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub mod codegen {
fn timeout(&self) -> Option<Duration> {
let s = self.metadata().get("grpc-timeout")?.to_str().unwrap();
let (value, unit) = s.split_at(s.len() - 1);
let value = value.parse::<u64>().ok()?;
let value = value.parse::<u64>().expect("invalid grpc-timeout value");
Some(match unit {
"H" => Duration::from_secs(value * 60 * 60),
"M" => Duration::from_secs(value * 60),
Expand Down

0 comments on commit 136e7dd

Please sign in to comment.