Skip to content

Commit

Permalink
Fix clippies
Browse files Browse the repository at this point in the history
Fixing the format_collect clippy will help using a stricter CI setup
  • Loading branch information
gagbo committed Dec 12, 2023
1 parent 787947a commit a387ca6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions providers/cloudwatch/src/client/canonical_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ impl CanonicalRequest<{ request_state::READY_TO_SIGN_V4 }> {

impl std::fmt::Display for CanonicalRequest<{ request_state::READY_TO_SIGN_V4 }> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
use std::fmt::Write;

let method = match self.method {
Method::GET => "GET",
Method::POST => "POST",
Expand All @@ -132,8 +134,10 @@ impl std::fmt::Display for CanonicalRequest<{ request_state::READY_TO_SIGN_V4 }>
let headers: String = self
.headers
.iter()
.map(|(k, v)| format!("{k}:{v}\n"))
.collect::<String>()
.try_fold(String::new(), |mut acc, (k, v)| {
writeln!(acc, "{k}:{v}")?;
Ok(acc)
})?
.trim_end()
.to_string();
let signed_headers = self.signed_headers();
Expand Down

0 comments on commit a387ca6

Please sign in to comment.