clippy: Fix option_map_unit_fn warnings (#31906)

This commit is contained in:
Oluwatobi Sofela 2024-03-27 19:43:56 +01:00 committed by GitHub
parent a5bcae212a
commit da76ebabe9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 43 additions and 30 deletions

View file

@ -1127,13 +1127,13 @@ impl XMLHttpRequest {
// Part of step 13, send() (processing response)
// XXXManishearth handle errors, if any (substep 1)
// Substep 2
status.map(|(code, reason)| {
if let Some((code, reason)) = status {
self.status.set(code);
*self.status_text.borrow_mut() = ByteString::new(reason);
});
headers
.as_ref()
.map(|h| *self.response_headers.borrow_mut() = h.clone());
}
if let Some(h) = headers.as_ref() {
*self.response_headers.borrow_mut() = h.clone();
}
{
let len = headers.and_then(|h| h.typed_get::<ContentLength>());
let mut response = self.response.borrow_mut();