Cleanup some unneeded let bindings

This commit is contained in:
David Zbarsky 2015-11-02 21:54:44 -08:00
parent 9fea6d2e46
commit dfc90db1d7
4 changed files with 12 additions and 21 deletions

View file

@ -85,19 +85,15 @@ impl KeyboardEvent {
let ev = KeyboardEvent::new_uninitialized(window); let ev = KeyboardEvent::new_uninitialized(window);
ev.InitKeyboardEvent(type_, canBubble, cancelable, view, key_string, location, ev.InitKeyboardEvent(type_, canBubble, cancelable, view, key_string, location,
DOMString::new(), repeat, DOMString::new()); DOMString::new(), repeat, DOMString::new());
// FIXME(https://github.com/rust-lang/rust/issues/23338) ev.key.set(key);
{ *ev.code.borrow_mut() = code;
let ev = ev.r(); ev.ctrl.set(ctrlKey);
ev.key.set(key); ev.alt.set(altKey);
*ev.code.borrow_mut() = code; ev.shift.set(shiftKey);
ev.ctrl.set(ctrlKey); ev.meta.set(metaKey);
ev.alt.set(altKey); ev.char_code.set(char_code);
ev.shift.set(shiftKey); ev.key_code.set(key_code);
ev.meta.set(metaKey); ev.is_composing.set(isComposing);
ev.char_code.set(char_code);
ev.key_code.set(key_code);
ev.is_composing.set(isComposing);
}
ev ev
} }

View file

@ -2150,9 +2150,7 @@ impl NodeMethods for Node {
let element = node.downcast::<Element>().unwrap(); let element = node.downcast::<Element>().unwrap();
let other_element = other.downcast::<Element>().unwrap(); let other_element = other.downcast::<Element>().unwrap();
assert!(element.attrs().len() == other_element.attrs().len()); assert!(element.attrs().len() == other_element.attrs().len());
// FIXME(https://github.com/rust-lang/rust/issues/23338) element.attrs().iter().all(|attr| {
let attrs = element.attrs();
attrs.iter().all(|attr| {
other_element.attrs().iter().any(|other_attr| { other_element.attrs().iter().any(|other_attr| {
(*attr.namespace() == *other_attr.namespace()) && (*attr.namespace() == *other_attr.namespace()) &&
(attr.local_name() == other_attr.local_name()) && (attr.local_name() == other_attr.local_name()) &&

View file

@ -1182,9 +1182,7 @@ impl Window {
browsing_context.frame_element().map(|frame_element| { browsing_context.frame_element().map(|frame_element| {
let window = window_from_node(frame_element); let window = window_from_node(frame_element);
// FIXME(https://github.com/rust-lang/rust/issues/23338) let context = window.browsing_context();
let r = window.r();
let context = r.browsing_context();
Root::from_ref(context.unwrap().active_window()) Root::from_ref(context.unwrap().active_window())
}) })
} }

View file

@ -38,9 +38,8 @@ full_cef_class_impl! {
this.browser.borrow_mut().as_mut().unwrap().send_window_event(event); this.browser.borrow_mut().as_mut().unwrap().send_window_event(event);
}} }}
fn get_url(&this,) -> cef_string_userfree_t {{ fn get_url(&this,) -> cef_string_userfree_t {{
let this = this.downcast();
// FIXME(https://github.com/rust-lang/rust/issues/23338) // FIXME(https://github.com/rust-lang/rust/issues/23338)
let url = this.url.borrow(); let url = this.downcast().url.borrow();
(*url).clone() (*url).clone()
}} }}
fn get_text(&this, visitor: *mut cef_string_visitor_t [CefStringVisitor],) -> () {{ fn get_text(&this, visitor: *mut cef_string_visitor_t [CefStringVisitor],) -> () {{