Skip to content

Commit

Permalink
Remove needless UTF-8 conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
jdisanti committed Nov 10, 2023
1 parent bc10bcc commit 85af035
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions rust-runtime/aws-smithy-http/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 85af035

Please sign in to comment.