From 31a628d667fae10d9bf9f385149508a546b707e3 Mon Sep 17 00:00:00 2001 From: C191239 Date: Mon, 12 Aug 2024 22:17:53 +0800 Subject: [PATCH] code review --- crates/util/identifier/src/lib.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/util/identifier/src/lib.rs b/crates/util/identifier/src/lib.rs index 1469c68..a2d870c 100644 --- a/crates/util/identifier/src/lib.rs +++ b/crates/util/identifier/src/lib.rs @@ -187,12 +187,8 @@ mod edcode { #[inline] fn decode(buf: B) -> Result> { let str = String::decode(buf)?; - Ok(Self::from_str(str.as_str()).map_err(|_| { - Box::new(io::Error::new( - ErrorKind::InvalidData, - format!("unable to parse identifier {str}"), - )) - })?) + Self::from_str(str.as_str()) + .map_err(|_| format!("unable to parse identifier {str}").into()) } } }