Browse Source

cargo clippy

root
neil 2 weeks ago
parent
commit
8276b35a01
3 changed files with 4 additions and 5 deletions
  1. +1
    -1
      src/database/methods.rs
  2. +1
    -1
      src/main.rs
  3. +2
    -3
      src/sniff.rs

+ 1
- 1
src/database/methods.rs View File

@ -44,7 +44,7 @@ impl Form {
.execute(conn)
}
pub fn insert<'b>(
pub fn insert(
i_form: InsertableForm,
conn: &DbConn,
) -> Result<InsertableForm, diesel::result::Error> {


+ 1
- 1
src/main.rs View File

@ -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.");
}


+ 2
- 3
src/sniff.rs View File

@ -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


Loading…
Cancel
Save