summaryrefslogtreecommitdiff
path: root/src/event.rs
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@openmailbox.org>2016-06-03 16:25:16 -0300
committerMatias Linares <matiaslina@openmailbox.org>2016-06-03 16:25:16 -0300
commit25034f8d4d70b4048d7540264fc18461982406aa (patch)
treebe189be1386f9e75b964ac7e0914832075cdeb1d /src/event.rs
parentda3fa00ccf4cde76d1d6489c6043d7e56d4f52c5 (diff)
downloaddotwm-25034f8d4d70b4048d7540264fc18461982406aa.tar.gz
Add Clippy as dependency.
This brings a lot of clean up on the code.
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)