aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/bindings/js.rs4
-rw-r--r--components/script/dom/cssstyledeclaration.rs8
-rw-r--r--components/script/dom/cssstylerule.rs2
-rw-r--r--components/script/dom/document.rs12
-rw-r--r--components/script/dom/medialist.rs4
-rw-r--r--components/script/dom/range.rs4
-rw-r--r--components/script/dom/servoparser/async_html.rs4
-rw-r--r--components/script/dom/url.rs4
-rw-r--r--components/script/dom/vrdisplay.rs2
-rw-r--r--components/script/dom/webglrenderingcontext.rs2
-rw-r--r--components/script/dom/xmlhttprequest.rs2
-rw-r--r--components/script/lib.rs1
12 files changed, 24 insertions, 25 deletions
diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs
index 975ddeda13b..abfd9f47eff 100644
--- a/components/script/dom/bindings/js.rs
+++ b/components/script/dom/bindings/js.rs
@@ -469,7 +469,7 @@ impl RootCollection {
/// Start tracking a stack-based root
unsafe fn root(&self, untracked_reflector: *const Reflector) {
debug_assert!(thread_state::get().is_script());
- let mut roots = &mut *self.roots.get();
+ let roots = &mut *self.roots.get();
roots.push(untracked_reflector);
assert!(!(*untracked_reflector).get_jsobject().is_null())
}
@@ -479,7 +479,7 @@ impl RootCollection {
assert!(!tracked_reflector.is_null());
assert!(!(*tracked_reflector).get_jsobject().is_null());
debug_assert!(thread_state::get().is_script());
- let mut roots = &mut *self.roots.get();
+ let roots = &mut *self.roots.get();
match roots.iter().rposition(|r| *r == tracked_reflector) {
Some(idx) => {
roots.remove(idx);
diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs
index 0732c9af9e4..ddf085b3491 100644
--- a/components/script/dom/cssstyledeclaration.rs
+++ b/components/script/dom/cssstyledeclaration.rs
@@ -238,7 +238,7 @@ impl CSSStyleDeclaration {
return Err(Error::NoModificationAllowed);
}
- self.owner.mutate_associated_block(|ref mut pdb, mut changed| {
+ self.owner.mutate_associated_block(|pdb, changed| {
if value.is_empty() {
// Step 3
*changed = pdb.remove_property(&id);
@@ -360,7 +360,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
_ => return Ok(()),
};
- self.owner.mutate_associated_block(|ref mut pdb, mut changed| {
+ self.owner.mutate_associated_block(|pdb, changed| {
// Step 5 & 6
*changed = pdb.set_importance(&id, importance);
});
@@ -388,7 +388,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
};
let mut string = String::new();
- self.owner.mutate_associated_block(|mut pdb, mut changed| {
+ self.owner.mutate_associated_block(|pdb, changed| {
pdb.property_value_to_css(&id, &mut string).unwrap();
*changed = pdb.remove_property(&id);
});
@@ -438,7 +438,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
}
let quirks_mode = window.Document().quirks_mode();
- self.owner.mutate_associated_block(|mut pdb, mut _changed| {
+ self.owner.mutate_associated_block(|pdb, _changed| {
// Step 3
*pdb = parse_style_attribute(&value,
&self.owner.base_url(),
diff --git a/components/script/dom/cssstylerule.rs b/components/script/dom/cssstylerule.rs
index a45e0ad20c8..42e56a5e8fc 100644
--- a/components/script/dom/cssstylerule.rs
+++ b/components/script/dom/cssstylerule.rs
@@ -100,7 +100,7 @@ impl CSSStyleRuleMethods for CSSStyleRule {
if let Ok(mut s) = SelectorList::parse(&parser, &mut css_parser) {
// This mirrors what we do in CSSStyleOwner::mutate_associated_block.
let mut guard = self.cssrule.shared_lock().write();
- let mut stylerule = self.stylerule.write_with(&mut guard);
+ let stylerule = self.stylerule.write_with(&mut guard);
mem::swap(&mut stylerule.selectors, &mut s);
// It seems like we will want to avoid having to invalidate all
// stylesheets eventually!
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index 4bc314fc7e4..39f5a8e6d38 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -633,7 +633,7 @@ impl Document {
// reset_form_owner_for_listeners -> reset_form_owner -> GetElementById
{
let mut id_map = self.id_map.borrow_mut();
- let mut elements = id_map.entry(id.clone()).or_insert(Vec::new());
+ let elements = id_map.entry(id.clone()).or_insert(Vec::new());
elements.insert_pre_order(element, root.r().upcast::<Node>());
}
self.reset_form_owner_for_listeners(&id);
@@ -642,7 +642,7 @@ impl Document {
pub fn register_form_id_listener<T: ?Sized + FormControl>(&self, id: DOMString, listener: &T) {
let mut map = self.form_id_listener_map.borrow_mut();
let listener = listener.to_element();
- let mut set = map.entry(Atom::from(id)).or_insert(HashSet::new());
+ let set = map.entry(Atom::from(id)).or_insert(HashSet::new());
set.insert(JS::from_ref(listener));
}
@@ -1559,7 +1559,7 @@ impl Document {
/// https://html.spec.whatwg.org/multipage/#dom-window-cancelanimationframe
pub fn cancel_animation_frame(&self, ident: u32) {
let mut list = self.animation_frame_list.borrow_mut();
- if let Some(mut pair) = list.iter_mut().find(|pair| pair.0 == ident) {
+ if let Some(pair) = list.iter_mut().find(|pair| pair.0 == ident) {
pair.1 = None;
}
}
@@ -2391,7 +2391,7 @@ impl Document {
if entry.snapshot.is_none() {
entry.snapshot = Some(Snapshot::new(el.html_element_in_html_document()));
}
- let mut snapshot = entry.snapshot.as_mut().unwrap();
+ let snapshot = entry.snapshot.as_mut().unwrap();
if snapshot.state.is_none() {
snapshot.state = Some(el.state());
}
@@ -2418,7 +2418,7 @@ impl Document {
entry.hint.insert(RESTYLE_SELF);
}
- let mut snapshot = entry.snapshot.as_mut().unwrap();
+ let snapshot = entry.snapshot.as_mut().unwrap();
if attr.local_name() == &local_name!("id") {
snapshot.id_changed = true;
} else if attr.local_name() == &local_name!("class") {
@@ -4019,7 +4019,7 @@ impl PendingInOrderScriptVec {
fn loaded(&self, element: &HTMLScriptElement, result: ScriptResult) {
let mut scripts = self.scripts.borrow_mut();
- let mut entry = scripts.iter_mut().find(|entry| &*entry.element == element).unwrap();
+ let entry = scripts.iter_mut().find(|entry| &*entry.element == element).unwrap();
entry.loaded(result);
}
diff --git a/components/script/dom/medialist.rs b/components/script/dom/medialist.rs
index 0064d044509..ae20f5aa042 100644
--- a/components/script/dom/medialist.rs
+++ b/components/script/dom/medialist.rs
@@ -63,7 +63,7 @@ impl MediaListMethods for MediaList {
// https://drafts.csswg.org/cssom/#dom-medialist-mediatext
fn SetMediaText(&self, value: DOMString) {
let mut guard = self.shared_lock().write();
- let mut media_queries = self.media_queries.write_with(&mut guard);
+ let media_queries = self.media_queries.write_with(&mut guard);
// Step 2
if value.is_empty() {
// Step 1
@@ -154,7 +154,7 @@ impl MediaListMethods for MediaList {
// Step 3
let m_serialized = m.unwrap().to_css_string();
let mut guard = self.shared_lock().write();
- let mut media_list = self.media_queries.write_with(&mut guard);
+ let media_list = self.media_queries.write_with(&mut guard);
let new_vec = media_list.media_queries.drain(..)
.filter(|q| m_serialized != q.to_css_string())
.collect();
diff --git a/components/script/dom/range.rs b/components/script/dom/range.rs
index fa849a0fc1a..1e65caedc9d 100644
--- a/components/script/dom/range.rs
+++ b/components/script/dom/range.rs
@@ -1049,7 +1049,7 @@ impl WeakRangeVec {
let offset = context.index();
let parent = context.parent;
unsafe {
- let mut ranges = &mut *self.cell.get();
+ let ranges = &mut *self.cell.get();
ranges.update(|entry| {
let range = entry.root().unwrap();
@@ -1076,7 +1076,7 @@ impl WeakRangeVec {
}
unsafe {
- let mut ranges = &mut *self.cell.get();
+ let ranges = &mut *self.cell.get();
ranges.update(|entry| {
let range = entry.root().unwrap();
diff --git a/components/script/dom/servoparser/async_html.rs b/components/script/dom/servoparser/async_html.rs
index 59411fda1c7..70d2008f49f 100644
--- a/components/script/dom/servoparser/async_html.rs
+++ b/components/script/dom/servoparser/async_html.rs
@@ -568,7 +568,7 @@ impl TreeSink for Sink {
}
let node = self.new_parse_node();
{
- let mut data = self.get_parse_node_data_mut(&target.id);
+ let data = self.get_parse_node_data_mut(&target.id);
data.contents = Some(node.clone());
}
self.send_op(ParseOperation::GetTemplateContents { target: target.id, contents: node.id });
@@ -596,7 +596,7 @@ impl TreeSink for Sink {
let mut node = self.new_parse_node();
node.qual_name = Some(name.clone());
{
- let mut node_data = self.get_parse_node_data_mut(&node.id);
+ let node_data = self.get_parse_node_data_mut(&node.id);
node_data.is_integration_point = html_attrs.iter()
.any(|attr| {
let attr_value = &String::from(attr.value.clone());
diff --git a/components/script/dom/url.rs b/components/script/dom/url.rs
index a02a735638f..41de4dcc0c7 100644
--- a/components/script/dom/url.rs
+++ b/components/script/dom/url.rs
@@ -96,8 +96,8 @@ impl URL {
// https://w3c.github.io/FileAPI/#dfn-createObjectURL
pub fn CreateObjectURL(global: &GlobalScope, blob: &Blob) -> DOMString {
- /// XXX: Second field is an unicode-serialized Origin, it is a temporary workaround
- /// and should not be trusted. See issue https://github.com/servo/servo/issues/11722
+ // XXX: Second field is an unicode-serialized Origin, it is a temporary workaround
+ // and should not be trusted. See issue https://github.com/servo/servo/issues/11722
let origin = get_blob_origin(&global.get_url());
let id = blob.get_blob_url_id();
diff --git a/components/script/dom/vrdisplay.rs b/components/script/dom/vrdisplay.rs
index 3f73a577fad..54f06fb928f 100644
--- a/components/script/dom/vrdisplay.rs
+++ b/components/script/dom/vrdisplay.rs
@@ -268,7 +268,7 @@ impl VRDisplayMethods for VRDisplay {
fn CancelAnimationFrame(&self, handle: u32) {
if self.presenting.get() {
let mut list = self.raf_callback_list.borrow_mut();
- if let Some(mut pair) = list.iter_mut().find(|pair| pair.0 == handle) {
+ if let Some(pair) = list.iter_mut().find(|pair| pair.0 == handle) {
pair.1 = None;
}
} else {
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs
index 48e6996b85f..20fe133e02c 100644
--- a/components/script/dom/webglrenderingcontext.rs
+++ b/components/script/dom/webglrenderingcontext.rs
@@ -2434,7 +2434,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
typedarray!(in(cx) let mut pixels_data: ArrayBufferView = pixels);
- let (array_type, mut data) = match { pixels_data.as_mut() } {
+ let (array_type, data) = match { pixels_data.as_mut() } {
Ok(data) => (data.get_array_type(), data.as_mut_slice()),
Err(_) => return Err(Error::Type("Not an ArrayBufferView".to_owned())),
};
diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs
index 6ed2dda1851..e6652d79d70 100644
--- a/components/script/dom/xmlhttprequest.rs
+++ b/components/script/dom/xmlhttprequest.rs
@@ -627,7 +627,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
if !content_type_set {
let ct = request.headers.get_mut::<ContentType>();
- if let Some(mut ct) = ct {
+ if let Some(ct) = ct {
if let Some(encoding) = encoding {
for param in &mut (ct.0).2 {
if param.0 == MimeAttr::Charset {
diff --git a/components/script/lib.rs b/components/script/lib.rs
index cab84d54294..223f00d33c2 100644
--- a/components/script/lib.rs
+++ b/components/script/lib.rs
@@ -10,7 +10,6 @@
#![feature(mpsc_select)]
#![feature(nonzero)]
#![feature(on_unimplemented)]
-#![feature(option_entry)]
#![feature(plugin)]
#![feature(proc_macro)]
#![feature(stmt_expr_attributes)]