Fix new warnings

This commit is contained in:
Simon Sapin 2019-01-04 15:27:23 +01:00
parent 5f422b6161
commit cf05e37c0b
3 changed files with 1 additions and 25 deletions

View file

@ -2,14 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::StyleSheetBinding;
use crate::dom::bindings::codegen::Bindings::StyleSheetBinding::StyleSheetMethods;
use crate::dom::bindings::inheritance::Castable;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::reflector::Reflector;
use crate::dom::bindings::str::DOMString;
use crate::dom::cssstylesheet::CSSStyleSheet;
use crate::dom::window::Window;
use dom_struct::dom_struct;
#[dom_struct]
@ -34,20 +31,6 @@ impl StyleSheet {
title: title,
}
}
#[allow(unrooted_must_root)]
pub fn new(
window: &Window,
type_: DOMString,
href: Option<DOMString>,
title: Option<DOMString>,
) -> DomRoot<StyleSheet> {
reflect_dom_object(
Box::new(StyleSheet::new_inherited(type_, href, title)),
window,
StyleSheetBinding::Wrap,
)
}
}
impl StyleSheetMethods for StyleSheet {

View file

@ -84,7 +84,6 @@ impl TreeWalkerMethods for TreeWalker {
match self.filter {
Filter::None => None,
Filter::Dom(ref nf) => Some(nf.clone()),
Filter::Native(_) => panic!("Cannot convert native node filter to DOM NodeFilter"),
}
}
@ -434,7 +433,6 @@ impl TreeWalker {
match self.filter {
// Step 4.
Filter::None => Ok(NodeFilterConstants::FILTER_ACCEPT),
Filter::Native(f) => Ok((f)(node)),
Filter::Dom(ref callback) => {
// Step 5.
self.active.set(true);
@ -479,6 +477,5 @@ impl<'a> Iterator for &'a TreeWalker {
#[derive(JSTraceable)]
pub enum Filter {
None,
Native(fn(node: &Node) -> u16),
Dom(Rc<NodeFilter>),
}

View file

@ -124,10 +124,6 @@ impl Worker {
Ok(worker)
}
pub fn is_closing(&self) -> bool {
self.closing.load(Ordering::SeqCst)
}
pub fn is_terminated(&self) -> bool {
self.terminated.get()
}