Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync changes from mozilla-central #3828

Merged
merged 9 commits into from Jan 10, 2020
Next

Bug 1607697 - Address some clippy lints in WebRender API. r=Gankro

  • Loading branch information
nical authored and moz-gfx committed Jan 10, 2020
commit b97f3a3408d97b3d39c02353cea9a78a9ddaf7bb
@@ -1636,7 +1636,7 @@ impl RenderApi {
for payload in document_payloads.drain(..).flatten() {
self.payload_sender.send_payload(payload).unwrap();
}
self.api_sender.send(ApiMsg::UpdateDocuments(document_ids.clone(), msgs)).unwrap();
self.api_sender.send(ApiMsg::UpdateDocuments(document_ids, msgs)).unwrap();
}

/// Does a hit test on display items in the specified document, at the given
@@ -1779,7 +1779,7 @@ impl ZoomFactor {
}

/// Get the zoom factor as an untyped float.
pub fn get(&self) -> f32 {
pub fn get(self) -> f32 {
self.0
}
}
@@ -1815,8 +1815,8 @@ pub struct PropertyBindingKey<T> {
/// Construct a property value from a given key and value.
impl<T: Copy> PropertyBindingKey<T> {
///
pub fn with(&self, value: T) -> PropertyValue<T> {
PropertyValue { key: *self, value }
pub fn with(self, value: T) -> PropertyValue<T> {
PropertyValue { key: self, value }
}
}

@@ -95,6 +95,8 @@ impl Ord for PremultipliedColorF {
self.partial_cmp(other).unwrap_or(cmp::Ordering::Equal)
}
}

#[cfg_attr(feature = "cargo-clippy", allow(clippy::derive_hash_xor_eq))]
impl Hash for PremultipliedColorF {
fn hash<H: Hasher>(&self, state: &mut H) {
// Note: this is inconsistent with the Eq impl for -0.0 (don't care).
@@ -533,8 +533,8 @@ pub enum BorderStyle {
}

impl BorderStyle {
pub fn is_hidden(&self) -> bool {
*self == BorderStyle::Hidden || *self == BorderStyle::None
pub fn is_hidden(self) -> bool {
self == BorderStyle::Hidden || self == BorderStyle::None
}
}

@@ -718,8 +718,8 @@ pub enum RasterSpace {
}

impl RasterSpace {
pub fn local_scale(&self) -> Option<f32> {
match *self {
pub fn local_scale(self) -> Option<f32> {
match self {
RasterSpace::Local(scale) => Some(scale),
RasterSpace::Screen => None,
}
@@ -1198,8 +1198,8 @@ pub enum YuvFormat {
}

impl YuvFormat {
pub fn get_plane_num(&self) -> usize {
match *self {
pub fn get_plane_num(self) -> usize {
match self {
YuvFormat::NV12 => 2,
YuvFormat::PlanarYCbCr => 3,
YuvFormat::InterleavedYCbCr => 1,
@@ -1360,7 +1360,7 @@ impl DisplayListBuilder {
filter_datas: &[di::FilterData],
filter_primitives: &[di::FilterPrimitive],
) {
if filters.len() > 0 {
if !filters.is_empty() {
self.push_item(&di::DisplayItem::SetFilterOps);
self.push_iter(filters);
}
@@ -402,6 +402,7 @@ impl Default for GlyphInstance {

impl Eq for GlyphInstance {}

#[cfg_attr(feature = "cargo-clippy", allow(clippy::derive_hash_xor_eq))]
impl Hash for GlyphInstance {
fn hash<H: Hasher>(&self, state: &mut H) {
// Note: this is inconsistent with the Eq impl for -0.0 (don't care).
@@ -46,7 +46,7 @@ pub struct BlobImageKey(pub ImageKey);

impl BlobImageKey {
/// Interpret this blob image as an image for a display item.
pub fn as_image(&self) -> ImageKey {
pub fn as_image(self) -> ImageKey {
self.0
}
}
@@ -12,7 +12,7 @@
//! there.

#![cfg_attr(feature = "nightly", feature(nonzero))]
#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, too_many_arguments, unreadable_literal))]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp, clippy::too_many_arguments, clippy::unreadable_literal, clippy::new_without_default))]

extern crate app_units;
#[macro_use]
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.