Skip to content

Commit

Permalink
fix(lints): len() can be called directly on strings (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
tessus authored Jan 10, 2025
1 parent ba0a183 commit def3805
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ mod tests {

async fn assert_body(body: BoxBody, expected: &str) -> Result<(), Error> {
if let BodySize::Sized(size) = body.size() {
assert_eq!(size, expected.as_bytes().len() as u64);
assert_eq!(size, expected.len() as u64);
let body_bytes = actix_web::body::to_bytes(body).await?;
let body_text = str::from_utf8(&body_bytes)?;
assert_eq!(expected, body_text);
Expand Down

0 comments on commit def3805

Please sign in to comment.