summaryrefslogtreecommitdiff
path: root/src/event.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/event.rs')
-rw-r--r--src/event.rs30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/event.rs b/src/event.rs
index b97686f..768e37a 100644
--- a/src/event.rs
+++ b/src/event.rs
@@ -56,21 +56,21 @@ pub enum Event {
impl fmt::Debug for Event {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- let s = match self {
- &Event::Key(ev, pressed) => format!("Key({}, {})", XEvent::from(ev).get_type(), pressed),
- &Event::Button(ev, pressed) => format!("Button({}, {})", XEvent::from(ev).get_type(), pressed),
- &Event::Drag(ev) => format!("Drag({})", XEvent::from(ev).get_type()),
- &Event::Generic(ev) => format!("Generic({})", XEvent::from(ev).get_type()),
- &Event::Enter(ev) => format!("Enter({})", XEvent::from(ev).get_type()),
- &Event::Leave(ev) => format!("Enter({})", XEvent::from(ev).get_type()),
- &Event::Create(ev) => format!("Create({})", XEvent::from(ev).get_type()),
- &Event::Destroy(ev) => format!("Destroy({})", XEvent::from(ev).get_type()),
- &Event::Unmap(ev) => format!("Unmap({})", XEvent::from(ev).get_type()),
- &Event::Map(ev) => format!("Map({})", XEvent::from(ev).get_type()),
- &Event::Configure(ev) => format!("Configure({})", XEvent::from(ev).get_type()),
- &Event::Expose(ev) => format!("Expose({})", XEvent::from(ev).get_type()),
- &Event::Socket(_) => format!("Socket()"),
- &Event::NoEvent => format!("NoEvent"),
+ let s = match *self {
+ Event::Key(ev, pressed) => format!("Key({}, {})", XEvent::from(ev).get_type(), pressed),
+ Event::Button(ev, pressed) => format!("Button({}, {})", XEvent::from(ev).get_type(), pressed),
+ Event::Drag(ev) => format!("Drag({})", XEvent::from(ev).get_type()),
+ Event::Generic(ev) => format!("Generic({})", XEvent::from(ev).get_type()),
+ Event::Enter(ev) => format!("Enter({})", XEvent::from(ev).get_type()),
+ Event::Leave(ev) => format!("Enter({})", XEvent::from(ev).get_type()),
+ Event::Create(ev) => format!("Create({})", XEvent::from(ev).get_type()),
+ Event::Destroy(ev) => format!("Destroy({})", XEvent::from(ev).get_type()),
+ Event::Unmap(ev) => format!("Unmap({})", XEvent::from(ev).get_type()),
+ Event::Map(ev) => format!("Map({})", XEvent::from(ev).get_type()),
+ Event::Configure(ev) => format!("Configure({})", XEvent::from(ev).get_type()),
+ Event::Expose(ev) => format!("Expose({})", XEvent::from(ev).get_type()),
+ Event::Socket(_) => String::from("Socket()"),
+ Event::NoEvent => String::from("NoEvent"),
};
write!(f, "{}", s)