Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bwinf
medal
Commits
95f039b7
Commit
95f039b7
authored
Oct 24, 2019
by
Robert Czechowski
Browse files
Fix: compile error due to unnecessary 'mut'
parent
2bb66a73
Pipeline
#247
passed with stages
in 15 minutes and 33 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/core.rs
View file @
95f039b7
...
...
@@ -3,7 +3,7 @@ use time;
use
db_conn
::
MedalConnection
;
use
db_objects
::
OptionSession
;
use
db_objects
::
SessionUser
;
use
db_objects
::{
Grade
,
Group
,
Submission
,
Taskgroup
,
Participation
};
use
db_objects
::{
Grade
,
Group
,
Participation
,
Submission
,
Taskgroup
};
use
helpers
;
use
oauth_provider
::
OauthProvider
;
use
webfw_iron
::{
json_val
,
to_json
};
...
...
@@ -247,7 +247,7 @@ pub fn show_contest<T: MedalConnection>(conn: &T, contest_id: i32, session_token
// Autostart if appropriate
if
opt_part
.is_none
()
&&
(
c
.duration
==
0
||
session
.is_teacher
)
{
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
{
...
...
@@ -278,7 +278,7 @@ pub fn show_contest<T: MedalConnection>(conn: &T, contest_id: i32, session_token
}
}
}
Ok
((
"contest"
.to_owned
(),
data
))
}
...
...
src/main.rs
View file @
95f039b7
...
...
@@ -607,7 +607,7 @@ mod tests {
.build
()
.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
);
let
mut
resp
=
client
.get
(
"http://localhost:8086/task/5"
)
.send
()
.unwrap
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment