diff options
Diffstat (limited to 'components/script/dom/keyboardevent.rs')
-rw-r--r-- | components/script/dom/keyboardevent.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/components/script/dom/keyboardevent.rs b/components/script/dom/keyboardevent.rs index e28f1c90c6c..518543c27ed 100644 --- a/components/script/dom/keyboardevent.rs +++ b/components/script/dom/keyboardevent.rs @@ -15,6 +15,8 @@ use dom::uievent::UIEvent; use dom::window::Window; use servo_msg::constellation_msg; use servo_util::str::DOMString; + +use std::borrow::ToOwned; use std::cell::{RefCell, Cell}; #[jstraceable] @@ -44,8 +46,8 @@ impl KeyboardEvent { fn new_inherited() -> KeyboardEvent { KeyboardEvent { uievent: UIEvent::new_inherited(EventTypeId::KeyboardEvent), - key: RefCell::new("".into_string()), - code: RefCell::new("".into_string()), + key: RefCell::new("".to_owned()), + code: RefCell::new("".to_owned()), location: Cell::new(0), ctrl: Cell::new(false), alt: Cell::new(false), @@ -83,7 +85,7 @@ impl KeyboardEvent { key_code: u32) -> Temporary<KeyboardEvent> { let ev = KeyboardEvent::new_uninitialized(window).root(); ev.r().InitKeyboardEvent(type_, canBubble, cancelable, view, key, location, - "".into_string(), repeat, "".into_string()); + "".to_owned(), repeat, "".to_owned()); *ev.r().code.borrow_mut() = code; ev.r().ctrl.set(ctrlKey); ev.r().alt.set(altKey); @@ -348,7 +350,7 @@ fn code_value(key: constellation_msg::Key) -> &'static str { constellation_msg::Key::GraveAccent | constellation_msg::Key::World1 | - constellation_msg::Key::World2 => panic!("unknown char code for {}", key), + constellation_msg::Key::World2 => panic!("unknown char code for {:?}", key), constellation_msg::Key::Escape => "Escape", constellation_msg::Key::Enter => "Enter", |