Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
clippy - refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
aloise committed Nov 20, 2020
1 parent f571bca commit bd2f718
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
5 changes: 1 addition & 4 deletions src/auth_middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ impl AuthContext {
}

pub fn admin_scope(auth_context: &AuthContext) -> bool {
match auth_context.subject {
Subject::Admin(_) => true,
_ => false,
}
matches!(auth_context.subject, Subject::Admin(_))
}

impl<S> FromRequest<S> for AuthContext {
Expand Down
4 changes: 0 additions & 4 deletions src/problem.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
use actix;
use actix_web;
use log::error;
use serde_derive::{Deserialize, Serialize};
use serde_json;
use std;

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct Problem {
Expand Down
2 changes: 1 addition & 1 deletion src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl Status {
}
}

pub fn status_resource<V: ToString, S: 'static>(version: Option<V>) -> impl FnOnce(&mut Resource<S>) -> () {
pub fn status_resource<V: ToString, S: 'static>(version: Option<V>) -> impl FnOnce(&mut Resource<S>) {
let status = Status::new(version);

|r: &mut Resource<S>| r.method(Method::GET).f(move |_| status.status())
Expand Down

0 comments on commit bd2f718

Please sign in to comment.