diff options
author | Johannes Linke <johannes.linke@posteo.de> | 2016-01-02 16:51:01 +0100 |
---|---|---|
committer | Johannes Linke <johannes.linke@posteo.de> | 2016-01-02 23:27:15 +0100 |
commit | 6b215f38eefc98853244c2ec6f4187ae6f000417 (patch) | |
tree | cf4dbc65e6b6fa641359b713f91b596bf9f9a666 /components/script/dom/window.rs | |
parent | b1ca3d1cdff412c5ae12113c3681f789becebabc (diff) | |
download | servo-6b215f38eefc98853244c2ec6f4187ae6f000417.tar.gz servo-6b215f38eefc98853244c2ec6f4187ae6f000417.zip |
Fix a bunch of clippy lints
Diffstat (limited to 'components/script/dom/window.rs')
-rw-r--r-- | components/script/dom/window.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index c373fc7eb38..c47b9164a43 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -323,7 +323,7 @@ impl Window { } pub fn css_error_reporter(&self) -> Box<ParseErrorReporter + Send> { - return self.error_reporter.clone(); + self.error_reporter.clone() } } @@ -782,9 +782,7 @@ impl WindowMethods for Window { // https://drafts.csswg.org/cssom-view/#dom-window-devicepixelratio fn DevicePixelRatio(&self) -> Finite<f64> { - let dpr = self.window_size.get() - .map(|data| data.device_pixel_ratio.get()) - .unwrap_or(1.0f32); + let dpr = self.window_size.get().map_or(1.0f32, |data| data.device_pixel_ratio.get()); Finite::wrap(dpr as f64) } } @@ -904,10 +902,10 @@ impl Window { let point = Point2D::new(x, y); let smooth = match behavior { ScrollBehavior::Auto => { - element.map(|_element| { + element.map_or(false, |_element| { // TODO check computed scroll-behaviour CSS property true - }).unwrap_or(false) + }) } ScrollBehavior::Instant => false, ScrollBehavior::Smooth => true |