Skip to content

Commit

Permalink
use type alias for normal web-result
Browse files Browse the repository at this point in the history
  • Loading branch information
syphar committed Nov 19, 2022
1 parent bacd58c commit d3cf24c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/web/sitemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ use crate::{
docbuilder::Limits,
impl_axum_webpage, impl_webpage,
utils::{get_config, ConfigName},
web::{error::AxumNope, page::WebPage},
web::{
error::{AxumNope, WebResult},
page::WebPage,
},
};
use anyhow::Context;
use axum::{
Expand Down Expand Up @@ -53,7 +56,7 @@ impl_axum_webpage! {
pub(crate) async fn sitemap_handler(
Path(letter): Path<String>,
Extension(pool): Extension<Pool>,
) -> Result<impl IntoResponse, AxumNope> {
) -> WebResult<impl IntoResponse> {
if letter.len() != 1 {
return Err(AxumNope::ResourceNotFound);
} else if let Some(ch) = letter.chars().next() {
Expand Down Expand Up @@ -112,7 +115,7 @@ impl_axum_webpage!(AboutBuilds = "core/about/builds.html");

pub(crate) async fn about_builds_handler(
Extension(pool): Extension<Pool>,
) -> Result<impl IntoResponse, AxumNope> {
) -> WebResult<impl IntoResponse> {
let rustc_version = spawn_blocking(move || -> anyhow::Result<_> {
let mut conn = pool.get()?;
get_config::<String>(&mut conn, ConfigName::RustcVersion)
Expand Down

0 comments on commit d3cf24c

Please sign in to comment.