diff --git a/crates/cast/bin/main.rs b/crates/cast/bin/main.rs index 044cc25ffd59..8bc0b986632b 100644 --- a/crates/cast/bin/main.rs +++ b/crates/cast/bin/main.rs @@ -66,7 +66,7 @@ async fn main() -> Result<()> { } CastSubcommand::ToAscii { hexdata } => { let value = stdin::unwrap(hexdata, false)?; - println!("{}", SimpleCast::to_ascii(&value)?); + println!("{}", SimpleCast::to_ascii(value.trim())?); } CastSubcommand::ToUtf8 { hexdata } => { let value = stdin::unwrap(hexdata, false)?; diff --git a/crates/cast/src/lib.rs b/crates/cast/src/lib.rs index 93e3c4a0fb63..7c2d970a7abb 100644 --- a/crates/cast/src/lib.rs +++ b/crates/cast/src/lib.rs @@ -168,7 +168,7 @@ where // handle case when return type is not specified Ok(if decoded.is_empty() { - format!("{res}\n") + res.to_string() } else if json { let tokens = decoded.iter().map(format_token_raw).collect::>(); serde_json::to_string_pretty(&tokens).unwrap() @@ -1503,7 +1503,7 @@ impl SimpleCast { /// decoded[1].as_address().unwrap().to_string().to_lowercase(), /// decoded[2].as_uint().unwrap().0.to_string(), /// decoded[3].as_uint().unwrap().0.to_string(), - /// hex::encode(decoded[4].as_bytes().unwrap()) + /// hex::encode(decoded[4].as_bytes().unwrap()) /// ] /// .into_iter() /// .collect::>();