mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #7987 - frewsxcv:clippy, r=Manishearth
Fix issues found by rust-clippy <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7987) <!-- Reviewable:end -->
This commit is contained in:
commit
eb7039d04d
23 changed files with 106 additions and 121 deletions
|
@ -154,7 +154,7 @@ impl Cookie {
|
|||
}
|
||||
}
|
||||
|
||||
if self.cookie.secure && url.scheme != "https".to_owned() {
|
||||
if self.cookie.secure && url.scheme != "https" {
|
||||
return false;
|
||||
}
|
||||
if self.cookie.httponly && source == CookieSource::NonHTTP {
|
||||
|
|
|
@ -75,10 +75,9 @@ fn send_error(url: Url, err: String, start_chan: LoadConsumer) {
|
|||
let mut metadata: Metadata = Metadata::default(url);
|
||||
metadata.status = None;
|
||||
|
||||
match start_sending_opt(start_chan, metadata) {
|
||||
Ok(p) => p.send(Done(Err(err))).unwrap(),
|
||||
_ => {}
|
||||
};
|
||||
if let Ok(p) = start_sending_opt(start_chan, metadata) {
|
||||
p.send(Done(Err(err))).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
enum ReadResult {
|
||||
|
@ -157,8 +156,8 @@ pub trait HttpResponse: Read {
|
|||
|
||||
fn content_encoding(&self) -> Option<Encoding> {
|
||||
self.headers().get::<ContentEncoding>().and_then(|h| {
|
||||
match h {
|
||||
&ContentEncoding(ref encodings) => {
|
||||
match *h {
|
||||
ContentEncoding(ref encodings) => {
|
||||
if encodings.contains(&Encoding::Gzip) {
|
||||
Some(Encoding::Gzip)
|
||||
} else if encodings.contains(&Encoding::Deflate) {
|
||||
|
|
|
@ -173,7 +173,7 @@ impl ResourceChannelManager {
|
|||
self.resource_manager.set_cookies_for_url(request, cookie_list, source)
|
||||
}
|
||||
ControlMsg::GetCookiesForUrl(url, consumer, source) => {
|
||||
let ref cookie_jar = self.resource_manager.cookie_storage;
|
||||
let cookie_jar = &self.resource_manager.cookie_storage;
|
||||
let mut cookie_jar = cookie_jar.write().unwrap();
|
||||
consumer.send(cookie_jar.cookies_for_url(&url, source)).unwrap();
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ impl ResourceManager {
|
|||
if let Ok(SetCookie(cookies)) = header {
|
||||
for bare_cookie in cookies {
|
||||
if let Some(cookie) = cookie::Cookie::new_wrapped(bare_cookie, &request, source) {
|
||||
let ref cookie_jar = self.cookie_storage;
|
||||
let cookie_jar = &self.cookie_storage;
|
||||
let mut cookie_jar = cookie_jar.write().unwrap();
|
||||
cookie_jar.push(cookie, source);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue