Skip to content

Commit

Permalink
Remove commented code and unnecessary operation
Browse files Browse the repository at this point in the history
  • Loading branch information
jdisanti committed Nov 30, 2023
1 parent 2f34974 commit 6242bbe
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions aws/rust-runtime/aws-sigv4/src/http_request/canonical_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 != ' ')
Expand All @@ -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<HeaderValue, CanonicalRequestError> {
Expand Down

0 comments on commit 6242bbe

Please sign in to comment.