diff --git a/server/src/channels.rs b/server/src/channels.rs index c88d362..6226891 100644 --- a/server/src/channels.rs +++ b/server/src/channels.rs @@ -162,7 +162,7 @@ fn parse_insert_channel_params(name: Option<&&str>, kind: Option<&&str>, desc: O } async fn insert_channel(pool: &Pool, channel: InsertableChannel) -> Result<(), Error> { let conn = pool.get_conn().await?; - let conn = conn.batch_exec( + conn.batch_exec( r"INSERT INTO channels (name, kind, description) VALUES (:name, :kind, :description)", params!{ "name" => channel.name, @@ -172,7 +172,7 @@ async fn insert_channel(pool: &Pool, channel: InsertableChannel) -> Result<(), E Ok(()) } -pub async fn create_channel(pool: &Pool, response: &Response, params: HashMap<&str, &str>) { +pub async fn create_channel(pool: &Pool, response: &mut Response, params: &HashMap<&str, &str>) { /* * Create a channel base on a few parameters that may or may not be there */ @@ -187,6 +187,6 @@ pub async fn create_channel(pool: &Pool, response: &Response, params: Hash Err(_) => *response.status_mut() = StatusCode::INTERNAL_SERVER_ERROR } }, - Err(e) => *response.status_mut() = StatusCode::BAD_REQUEST + Err(_) => *response.status_mut() = StatusCode::BAD_REQUEST } } \ No newline at end of file