cargo clippy

This commit is contained in:
neil 2021-03-24 20:29:24 +01:00
parent c1191f3f45
commit 8276b35a01
3 changed files with 4 additions and 5 deletions

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

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

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