From a364d09b76654c17d6f60a97fa9ab6c42b06edaa Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Tue, 28 Nov 2023 15:52:27 -0800 Subject: [PATCH] Remove commented code and unnecessary operation --- .../aws-sigv4/src/http_request/canonical_request.rs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/aws/rust-runtime/aws-sigv4/src/http_request/canonical_request.rs b/aws/rust-runtime/aws-sigv4/src/http_request/canonical_request.rs index 86a2bd69ded..32b6cfe4f3d 100644 --- a/aws/rust-runtime/aws-sigv4/src/http_request/canonical_request.rs +++ b/aws/rust-runtime/aws-sigv4/src/http_request/canonical_request.rs @@ -442,8 +442,6 @@ fn trim_all(text: &str) -> Cow<'_, str> { // S3 ONLY trims spaces so we use trim_matches to trim spaces only Cow::Owned( text.chars() - // Skip leading spaces - .skip_while(|c| *c == ' ') // Filter out consecutive spaces .zip(text.chars().skip(1).chain(std::iter::once('!'))) .filter(|(a, b)| *a != ' ' || *b != ' ') @@ -453,15 +451,6 @@ fn trim_all(text: &str) -> Cow<'_, str> { } } -/// Removes excess spaces before and after a given byte string by returning a subset of those bytes. -/// Will return an empty slice if a string is composed entirely of whitespace. -//fn trim_spaces_from_byte_string(bytes: &str) -> &str { -// let starting_index = bytes.iter().position(|b| *b != b' ').unwrap_or(0); -// let ending_offset = bytes.iter().rev().position(|b| *b != b' ').unwrap_or(0); -// let ending_index = bytes.len() - ending_offset; -// &bytes[starting_index..ending_index] -//} - /// Works just like [trim_all] but acts on HeaderValues instead of bytes. /// Will ensure that the underlying bytes are valid UTF-8. fn normalize_header_value(header_value: &str) -> Result {