summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-08-30 12:49:22 -0400
committerBen Morrison <ben@gbmor.dev>2019-08-30 12:49:22 -0400
commit94e8df5a92c762dfe50a48326edef3e9d58e5574 (patch)
tree14baaa19f76baf0fa72395c8fd9da3216f5d38d2
parentdf6f3d1bb8b62599e6f7d3b9c17bea7f1f6250bb (diff)
downloadclinte-94e8df5a92c762dfe50a48326edef3e9d58e5574.tar.gz
delinting
-rw-r--r--src/main.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs
index 65a6022..2ae609a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -13,7 +13,6 @@ fn main() {
         .version(clap::crate_version!())
         .author("Ben Morrison (gbmor)")
         .about("Command-line community notices system")
-        //.subcommand(clap::SubCommand::with_name("list").about("Display notices"))
         .subcommand(clap::SubCommand::with_name("post").about("Post a new notice"))
         /*.subcommand(
             clap::SubCommand::with_name("update")
@@ -38,7 +37,7 @@ fn main() {
 
     info!("Startup completed in {:?}ms", start.elapsed().as_millis());
 
-    if let Some(_) = arg_matches.subcommand_matches("post") {
+    if arg_matches.subcommand_matches("post").is_some() {
         info!("New post...");
         post(&db);
         list_matches(&db);
@@ -76,9 +75,7 @@ fn list_matches(db: &db::Conn) {
     });
 
     for (i, e) in postvec.iter().enumerate() {
-        if postvec.len() >= 30 && i >= postvec.len() - 31 {
-            print!("{}", e);
-        } else if postvec.len() < 30 {
+        if (postvec.len() >= 30 && i >= postvec.len() - 31) || postvec.len() < 30 {
             print!("{}", e);
         }
     }