From 85af0354cf2a91e4a065a5232b9357ab40e6257f Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Fri, 10 Nov 2023 15:45:46 -0800 Subject: [PATCH] Remove needless UTF-8 conversion --- rust-runtime/aws-smithy-http/src/header.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rust-runtime/aws-smithy-http/src/header.rs b/rust-runtime/aws-smithy-http/src/header.rs index 605c406a09..558fe13e01 100644 --- a/rust-runtime/aws-smithy-http/src/header.rs +++ b/rust-runtime/aws-smithy-http/src/header.rs @@ -140,10 +140,8 @@ where Some(v) => v, None => return Ok(None), }; - let value = - std::str::from_utf8(first.as_bytes()).map_err(|_| ParseError::new("invalid utf-8"))?; match values.next() { - None => T::from_str(value.trim()) + None => T::from_str(first.trim()) .map_err(|err| ParseError::new("failed to parse string").with_source(err)) .map(Some), Some(_) => Err(ParseError::new(