diff options
author | Matias Linares <matiaslina@openmailbox.org> | 2016-06-03 16:25:16 -0300 |
---|---|---|
committer | Matias Linares <matiaslina@openmailbox.org> | 2016-06-03 16:25:16 -0300 |
commit | 25034f8d4d70b4048d7540264fc18461982406aa (patch) | |
tree | be189be1386f9e75b964ac7e0914832075cdeb1d /src/main.rs | |
parent | da3fa00ccf4cde76d1d6489c6043d7e56d4f52c5 (diff) | |
download | dotwm-25034f8d4d70b4048d7540264fc18461982406aa.tar.gz |
Add Clippy as dependency.
This brings a lot of clean up on the code.
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index 4f292b6..b1873f3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,7 @@ // See LICENSE file for copyright and license details. +#![cfg_attr(feature="clippy", feature(plugin))] +#![cfg_attr(feature="clippy", plugin(clippy))] extern crate libc; extern crate x11; extern crate unix_socket; @@ -32,9 +34,8 @@ const SOCKET_PATH: &'static str = "./dotwm.sock"; fn run_autostart() { let paths = &["./autostart", "/home/matias/.config/dotwm/autostart"]; for path in paths { - match exec_cmd(path, &[]) { - Ok(_) => break, - Err(_) => (), + if exec_cmd(path, &[]).is_ok() { + break; } } } @@ -86,7 +87,7 @@ fn main() { s.read_to_string(&mut buf).unwrap(); for line in buf.lines() { - let res = parser::parse(&line); + let res = parser::parse(line); match res { Ok(pcmd) => { pcmd.handle(&mut dotwm, &mut bindings); |