From 50962598e52a37bf63da25cf16eb5733fe907a80 Mon Sep 17 00:00:00 2001 From: shockrah Date: Wed, 3 Jun 2020 00:14:45 -0700 Subject: [PATCH] fixed borrow/moving issue with create_channel call removed some unsed variables --- server/src/channels.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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