Commit a57c8413 authored by Robert Czechowski's avatar Robert Czechowski
Browse files

Remove unnecessary uses of 'mut'

parent 56578fed
......@@ -31,14 +31,14 @@ pub fn parse_yaml(content: &str, filename: &str, directory: &str) -> Option<Cont
let mut taskgroup = Taskgroup::new(name);
match info {
serde_yaml::Value::String(taskdir) => {
let mut task = Task::new(taskdir, 3);
let task = Task::new(taskdir, 3);
taskgroup.tasks.push(task);
}
serde_yaml::Value::Sequence(taskdirs) => {
let mut stars = 2;
for taskdir in taskdirs {
if let serde_yaml::Value::String(taskdir) = taskdir {
let mut task = Task::new(taskdir, stars);
let task = Task::new(taskdir, stars);
taskgroup.tasks.push(task);
} else {
panic!("Invalid contest YAML: {}{} (a)", directory, filename)
......@@ -58,7 +58,7 @@ pub fn parse_yaml(content: &str, filename: &str, directory: &str) -> Option<Cont
{
stars = cstars.as_u64().unwrap() as u8;
}
let mut task = Task::new(taskdir, stars);
let task = Task::new(taskdir, stars);
taskgroup.tasks.push(task);
stars += 1;
} else {
......
......@@ -421,7 +421,7 @@ impl MedalConnection for Connection {
.unwrap();
if let Some(t /*Ok((grade, mut group, mut userinfo))*/) = gradeinfo_iter.next() {
let (grade, mut group, mut userinfo) = t.unwrap();
let (grade, group, userinfo) = t.unwrap();
let mut grades: Vec<Grade> = vec![Default::default(); n_tasks];
let mut users: Vec<(UserInfo, Vec<Grade>)> = Vec::new();
......
......@@ -182,7 +182,7 @@ pub fn show_contest<T: MedalConnection>(conn: &T, contest_id: u32, session_token
let mut tasks = Vec::new();
for (taskgroup, grade) in c.taskgroups.into_iter().zip(grades) {
let mut subtaskstars = generate_subtaskstars(&taskgroup, &grade, None);
let subtaskstars = generate_subtaskstars(&taskgroup, &grade, None);
let ti = TaskInfo { name: taskgroup.name, subtasks: subtaskstars };
tasks.push(ti);
......
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