mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Infer types when appropriate
This commit is contained in:
parent
1dfc0481ef
commit
7e786fb8ac
2 changed files with 3 additions and 3 deletions
|
@ -189,7 +189,7 @@ pub unsafe fn get_attr_for_layout<'a>(elem: &'a Element, namespace: &Namespace,
|
||||||
-> Option<LayoutJS<Attr>> {
|
-> Option<LayoutJS<Attr>> {
|
||||||
// cast to point to T in RefCell<T> directly
|
// cast to point to T in RefCell<T> directly
|
||||||
let attrs = elem.attrs.borrow_for_layout();
|
let attrs = elem.attrs.borrow_for_layout();
|
||||||
attrs.iter().find(|attr: & &JS<Attr>| {
|
attrs.iter().find(|attr| {
|
||||||
let attr = attr.to_layout();
|
let attr = attr.to_layout();
|
||||||
*name == attr.local_name_atom_forever() &&
|
*name == attr.local_name_atom_forever() &&
|
||||||
(*attr.unsafe_get()).namespace() == namespace
|
(*attr.unsafe_get()).namespace() == namespace
|
||||||
|
@ -216,7 +216,7 @@ impl RawLayoutElementHelpers for Element {
|
||||||
#[inline]
|
#[inline]
|
||||||
unsafe fn get_attr_vals_for_layout<'a>(&'a self, name: &Atom) -> Vec<&'a str> {
|
unsafe fn get_attr_vals_for_layout<'a>(&'a self, name: &Atom) -> Vec<&'a str> {
|
||||||
let attrs = self.attrs.borrow_for_layout();
|
let attrs = self.attrs.borrow_for_layout();
|
||||||
(*attrs).iter().filter_map(|attr: &JS<Attr>| {
|
attrs.iter().filter_map(|attr| {
|
||||||
let attr = attr.to_layout();
|
let attr = attr.to_layout();
|
||||||
if *name == attr.local_name_atom_forever() {
|
if *name == attr.local_name_atom_forever() {
|
||||||
Some(attr.value_ref_forever())
|
Some(attr.value_ref_forever())
|
||||||
|
|
|
@ -881,7 +881,7 @@ impl XMLHttpRequest {
|
||||||
_ => "error",
|
_ => "error",
|
||||||
};
|
};
|
||||||
|
|
||||||
let upload_complete: &Cell<bool> = &self.upload_complete;
|
let upload_complete = &self.upload_complete;
|
||||||
if !upload_complete.get() {
|
if !upload_complete.get() {
|
||||||
upload_complete.set(true);
|
upload_complete.set(true);
|
||||||
self.dispatch_upload_progress_event("progress".to_owned(), None);
|
self.dispatch_upload_progress_event("progress".to_owned(), None);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue