From ed778f5eb25b9e9e1961c77e3ffafc49d5cdc32c Mon Sep 17 00:00:00 2001 From: Pauan Date: Thu, 18 Jul 2019 23:12:49 +0200 Subject: [PATCH] Adding in PartialEq and Eq to web-sys types --- crates/web-sys/tests/wasm/element.rs | 2 ++ crates/webidl/src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/web-sys/tests/wasm/element.rs b/crates/web-sys/tests/wasm/element.rs index 0092c41f811..a408a9c7cdf 100644 --- a/crates/web-sys/tests/wasm/element.rs +++ b/crates/web-sys/tests/wasm/element.rs @@ -14,6 +14,8 @@ fn element() { */ let element = new_div(); + assert_eq!(element, element); + assert_eq!(element.prefix(), None, "Shouldn't have a prefix"); assert_eq!(element.local_name(), "div", "Should have a div local name"); assert_eq!(element.tag_name(), "DIV", "Should be a div tag"); diff --git a/crates/webidl/src/lib.rs b/crates/webidl/src/lib.rs index 864455376e3..c6225f360c8 100644 --- a/crates/webidl/src/lib.rs +++ b/crates/webidl/src/lib.rs @@ -541,7 +541,7 @@ impl<'src> FirstPassRecord<'src> { let mut doc_comment = Some(format!("The `{}` object\n\n{}", name, mdn_doc(name, None),)); let mut attrs = Vec::new(); - attrs.push(syn::parse_quote!( #[derive(Debug, Clone)] )); + attrs.push(syn::parse_quote!( #[derive(Debug, Clone, PartialEq, Eq)] )); self.add_deprecated(data, &mut attrs); let mut import_type = ast::ImportType { vis: public(),