Commit 95f039b7 authored by Robert Czechowski's avatar Robert Czechowski
Browse files

Fix: compile error due to unnecessary 'mut'

parent 2bb66a73
Pipeline #247 passed with stages
in 15 minutes and 33 seconds
...@@ -3,7 +3,7 @@ use time; ...@@ -3,7 +3,7 @@ use time;
use db_conn::MedalConnection; use db_conn::MedalConnection;
use db_objects::OptionSession; use db_objects::OptionSession;
use db_objects::SessionUser; use db_objects::SessionUser;
use db_objects::{Grade, Group, Submission, Taskgroup, Participation}; use db_objects::{Grade, Group, Participation, Submission, Taskgroup};
use helpers; use helpers;
use oauth_provider::OauthProvider; use oauth_provider::OauthProvider;
use webfw_iron::{json_val, to_json}; use webfw_iron::{json_val, to_json};
...@@ -247,7 +247,7 @@ pub fn show_contest<T: MedalConnection>(conn: &T, contest_id: i32, session_token ...@@ -247,7 +247,7 @@ pub fn show_contest<T: MedalConnection>(conn: &T, contest_id: i32, session_token
// Autostart if appropriate // Autostart if appropriate
if opt_part.is_none() && (c.duration == 0 || session.is_teacher) { if opt_part.is_none() && (c.duration == 0 || session.is_teacher) {
conn.new_participation(&session_token, contest_id).map_err(|_| MedalError::AccessDenied)?; conn.new_participation(&session_token, contest_id).map_err(|_| MedalError::AccessDenied)?;
opt_part = Some(Participation { contest: contest_id, user: session.id, start: time::get_time()}); opt_part = Some(Participation { contest: contest_id, user: session.id, start: time::get_time() });
} }
if let Some(participation) = opt_part { if let Some(participation) = opt_part {
...@@ -278,7 +278,7 @@ pub fn show_contest<T: MedalConnection>(conn: &T, contest_id: i32, session_token ...@@ -278,7 +278,7 @@ pub fn show_contest<T: MedalConnection>(conn: &T, contest_id: i32, session_token
} }
} }
} }
Ok(("contest".to_owned(), data)) Ok(("contest".to_owned(), data))
} }
......
...@@ -607,7 +607,7 @@ mod tests { ...@@ -607,7 +607,7 @@ mod tests {
.build() .build()
.unwrap(); .unwrap();
let mut resp = client.get("http://localhost:8086/contest/3").send().unwrap(); let resp = client.get("http://localhost:8086/contest/3").send().unwrap();
assert_eq!(resp.status(), StatusCode::OK); assert_eq!(resp.status(), StatusCode::OK);
let mut resp = client.get("http://localhost:8086/task/5").send().unwrap(); let mut resp = client.get("http://localhost:8086/task/5").send().unwrap();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment