Skip to content

Commit

Permalink
Fix warnings from Clippy v1.50.0 (nightly). (#58)
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Sikora <[email protected]>
  • Loading branch information
PiotrSikora authored Dec 4, 2020
1 parent 7de2acd commit 85f92f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/http_body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl HttpContext for HttpBody {
// Since we returned "Pause" previuously, this will return the whole body.
if let Some(body_bytes) = self.get_http_response_body(0, body_size) {
let body_str = String::from_utf8(body_bytes).unwrap();
if body_str.find("secret").is_some() {
if body_str.contains("secret") {
let new_body = format!("Original message body ({} bytes) redacted.", body_size);
self.set_http_response_body(0, body_size, &new_body.into_bytes());
}
Expand Down

0 comments on commit 85f92f8

Please sign in to comment.