aboutsummaryrefslogtreecommitdiff
path: root/ticket/src/tui.rs
diff options
context:
space:
mode:
authorMichael Gattozzi <mgattozzi@gmail.com>2019-12-09 17:42:08 -0500
committerMichael Gattozzi <mgattozzi@gmail.com>2019-12-10 13:17:08 -0500
commit1dec32c37ac2f563e164021c9f21052f11fd1d20 (patch)
tree8d5508b09b742e63e72fbbf1571b5667b3ec0e1e /ticket/src/tui.rs
parentfcd4ccbec30493872feba137342347541b6a4e28 (diff)
Make the pre-commit script pedantic and fix errors
This commit really ups the level and quality of the Rust code by setting clippy to pedantic mode. It also fixes an issue where bash continued to run scripts even if something failed with a non-zero exit status. We also deny all warnings so as to actually fail the builds and the commit hooks. This should make sure code quality stays at a high level.
Diffstat (limited to '')
-rw-r--r--ticket/src/tui.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/ticket/src/tui.rs b/ticket/src/tui.rs
index e1aa666..01f00bf 100644
--- a/ticket/src/tui.rs
+++ b/ticket/src/tui.rs
@@ -130,8 +130,8 @@ pub struct Config {
}
impl Default for Config {
- fn default() -> Config {
- Config {
+ fn default() -> Self {
+ Self {
exit_key: Key::Char('q'),
tick_rate: Duration::from_millis(250),
}
@@ -139,11 +139,11 @@ impl Default for Config {
}
impl Events {
- pub fn new() -> Events {
- Events::with_config(Config::default())
+ pub fn new() -> Self {
+ Self::with_config(Config::default())
}
- pub fn with_config(config: Config) -> Events {
+ pub fn with_config(config: Config) -> Self {
let (tx, rx) = mpsc::channel();
let input_handle = {
let tx = tx.clone();
@@ -171,7 +171,7 @@ impl Events {
}
})
};
- Events {
+ Self {
rx,
input_handle,
tick_handle,
@@ -198,8 +198,8 @@ pub fn run() -> Result<()> {
tabs: TabsState::new(vec!["Open", "Closed"]),
tickets: {
let mut map = BTreeMap::new();
- map.insert("Open".into(), get_open_tickets()?);
- map.insert("Closed".into(), get_closed_tickets()?);
+ let _ = map.insert("Open".into(), get_open_tickets()?);
+ let _ = map.insert("Closed".into(), get_closed_tickets()?);
TicketState::new(map)
},
};