More warning removals and more db-lib result wrapping

This should be everything now
This commit is contained in:
shockrah
2021-03-30 23:00:50 -07:00
parent 4615374357
commit afdeef0a49
4 changed files with 14 additions and 9 deletions

View File

@@ -3,7 +3,7 @@ use mysql_async::prelude::Queryable;
use mysql_async::Error as SqlError;
use crate::{Channel, UBigInt, Integer};
use crate::{sql_err, Response};
use crate::Response;
use rand::RngCore;
@@ -75,11 +75,8 @@ impl Channel {
let mut conn = p.get_conn().await?;
let q = "DELETE FROM channels WHERE id = :id";
let result = conn.exec_drop(q, params!{"id" => id}).await;
return match result {
Ok(_) => Ok(Response::Success),
Err(sql) => Ok(Response::Other(sql_err!(sql)))
}
conn.exec_drop(q, params!{"id" => id}).await?;
Ok(Response::Success)
}