Skip to content

Commit

Permalink
lints
Browse files Browse the repository at this point in the history
  • Loading branch information
aspect committed Sep 14, 2024
1 parent 92d6492 commit ce52c67
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub enum RequestKind {
#[template(path = "index.html", escape = "none")]
struct IndexTemplate {
access: bool,
version : &'static str,
version: &'static str,
}

pub async fn logout_handler(resolver: &Arc<Resolver>, req: Request<Body>) -> impl IntoResponse {
Expand Down Expand Up @@ -120,7 +120,10 @@ pub async fn status_handler(resolver: &Arc<Resolver>, req: RequestKind) -> impl
Ok((Some(session), cookie)) => {
session.touch();

let index = IndexTemplate { access: true, version : crate::VERSION };
let index = IndexTemplate {
access: true,
version: crate::VERSION,
};

if let Some(cookie) = cookie {
Response::builder()
Expand Down Expand Up @@ -152,11 +155,17 @@ pub async fn status_handler(resolver: &Arc<Resolver>, req: RequestKind) -> impl
.body(Body::from(msg))
.unwrap(),
Err(Error::Unauthorized) => {
let index = IndexTemplate { access: false, version : crate::VERSION };
let index = IndexTemplate {
access: false,
version: crate::VERSION,
};
NoCacheHtml(index.render().unwrap()).into_response()
}
_ => {
let index = IndexTemplate { access: false, version : crate::VERSION };
let index = IndexTemplate {
access: false,
version: crate::VERSION,
};
NoCacheHtml(index.render().unwrap()).into_response()
}
}
Expand Down

0 comments on commit ce52c67

Please sign in to comment.