From 4610a7737fd3e928d7dd777b9659fc37ed091268 Mon Sep 17 00:00:00 2001 From: YaroShkvorets Date: Sat, 16 Mar 2024 20:51:06 -0400 Subject: [PATCH] just panic --- antelope.trxstats/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/antelope.trxstats/src/lib.rs b/antelope.trxstats/src/lib.rs index 42d3823..a53ce3d 100644 --- a/antelope.trxstats/src/lib.rs +++ b/antelope.trxstats/src/lib.rs @@ -25,10 +25,10 @@ fn parse_params(input: String) -> Result { for param in input.split('&') { let (key, value) = param .split_once('=') - .ok_or_else(|| SubstreamsError::Unexpected(format!("Invalid parameter format: {}", param)))?; + .expect(format!("Invalid parameter format: {}", param).as_str()); let parsed_value = value .parse::() - .map_err(|_| SubstreamsError::Unexpected(format!("Invalid param value for key '{}'", key)))?; + .expect(format!("Invalid param value for key '{}'", key).as_str()); match key { "cpu_elapsed" => result.cpu_elapsed = parsed_value, @@ -36,7 +36,7 @@ fn parse_params(input: String) -> Result { "cpu_usage" => result.cpu_usage = parsed_value, "net_usage" => result.net_usage = parsed_value, "action_count" => result.action_count = parsed_value, - _ => return Err(SubstreamsError::Unexpected(format!("Unknown parameter: '{}'", key))), + _ => panic!("Unknown parameter: '{}'", key), } }