From 8276b35a0140b55955579caafd11fc5a83a1c6ec Mon Sep 17 00:00:00 2001 From: neil Date: Wed, 24 Mar 2021 20:29:24 +0100 Subject: [PATCH] cargo clippy --- src/database/methods.rs | 2 +- src/main.rs | 2 +- src/sniff.rs | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/database/methods.rs b/src/database/methods.rs index 5b932bb..72223ad 100644 --- a/src/database/methods.rs +++ b/src/database/methods.rs @@ -44,7 +44,7 @@ impl Form { .execute(conn) } - pub fn insert<'b>( + pub fn insert( i_form: InsertableForm, conn: &DbConn, ) -> Result { diff --git a/src/main.rs b/src/main.rs index 250ecfb..fb54ea1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -59,7 +59,7 @@ async fn main() -> std::io::Result<()> { println!("Checking configuration file..."); CONFIG.check_version(); - if CONFIG.database_path.len() == 0 { + if CONFIG.database_path.is_empty() { println!("No database specified. Please enter a MySQL, PostgreSQL or SQLite connection string in config.toml."); } diff --git a/src/sniff.rs b/src/sniff.rs index 32315e9..d161712 100644 --- a/src/sniff.rs +++ b/src/sniff.rs @@ -59,11 +59,10 @@ pub fn check_new_form(body: &web::Bytes) -> u64 { && v["ocs"]["data"]["isAnonymous"] == Value::Null { //getting form id - let new_v_id = v["ocs"]["data"]["id"].as_u64().unwrap_or_else(|| { + v["ocs"]["data"]["id"].as_u64().unwrap_or_else(|| { eprintln!("check_new_form: failed to parse formid: {}", v); 0 - }); - new_v_id + }) } else { eprintln!("error: check_new_form: can't find formid: {}", v); 0