Commit c3bbdba5 authored by Robert Czechowski's avatar Robert Czechowski Committed by Robert Czechowski

Fix clippy complaints

parent 6ba41732
......@@ -138,7 +138,7 @@ impl AroundMiddleware for RequestTimeLogger {
Box::new(move |req: &mut Request| -> IronResult<Response> {
// Set thresholds
let (threshold, threshold_critical) = match req.url.path().iter().next() {
let (threshold, threshold_critical) = match req.url.path().get(0) {
Some(&"save") => (Duration::from_millis(80), Duration::from_millis(120)),
Some(&"contest") => (Duration::from_millis(80), Duration::from_millis(120)),
Some(&"oauth") => (Duration::from_millis(800), Duration::from_millis(3200)),
......@@ -261,7 +261,7 @@ impl<'a, 'b> RequestRouterParam for Request<'a, 'b> {
}
fn get_int<T: ::std::str::FromStr>(&mut self, key: &str) -> Option<T> {
Some(self.extensions.get::<Router>()?.find(key)?.parse::<T>().ok()?)
self.extensions.get::<Router>()?.find(key)?.parse::<T>().ok()
}
fn expect_int<T: ::std::str::FromStr>(&mut self, key: &str) -> IronResult<T> {
......
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