Skip to content

Commit

Permalink
rename WebResult into AxumResult
Browse files Browse the repository at this point in the history
  • Loading branch information
syphar committed Nov 21, 2022
1 parent 8f3666d commit 83ad0bb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/web/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ impl IntoResponse for AxumNope {
}
}

pub(crate) type WebResult<T> = Result<T, AxumNope>;
pub(crate) type AxumResult<T> = Result<T, AxumNope>;

#[cfg(test)]
mod tests {
Expand Down
12 changes: 6 additions & 6 deletions src/web/releases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
impl_axum_webpage, impl_webpage,
utils::{report_error, spawn_blocking},
web::{
error::{Nope, WebResult},
error::{AxumResult, Nope},
match_version,
page::WebPage,
parse_url_with_params, redirect_base,
Expand Down Expand Up @@ -323,7 +323,7 @@ pub(crate) async fn releases_handler(
pool: Pool,
page: Option<i64>,
release_type: ReleaseType,
) -> WebResult<impl IntoResponse> {
) -> AxumResult<impl IntoResponse> {
let page_number = page.unwrap_or(1);

let (description, release_order, latest_only) = match release_type {
Expand Down Expand Up @@ -377,28 +377,28 @@ pub(crate) async fn releases_handler(
pub(crate) async fn recent_releases_handler(
page: Option<Path<i64>>,
Extension(pool): Extension<Pool>,
) -> WebResult<impl IntoResponse> {
) -> AxumResult<impl IntoResponse> {
releases_handler(pool, page.map(|p| p.0), ReleaseType::Recent).await
}

pub(crate) async fn releases_by_stars_handler(
page: Option<Path<i64>>,
Extension(pool): Extension<Pool>,
) -> WebResult<impl IntoResponse> {
) -> AxumResult<impl IntoResponse> {
releases_handler(pool, page.map(|p| p.0), ReleaseType::Stars).await
}

pub(crate) async fn releases_recent_failures_handler(
page: Option<Path<i64>>,
Extension(pool): Extension<Pool>,
) -> WebResult<impl IntoResponse> {
) -> AxumResult<impl IntoResponse> {
releases_handler(pool, page.map(|p| p.0), ReleaseType::RecentFailures).await
}

pub(crate) async fn releases_failures_by_stars_handler(
page: Option<Path<i64>>,
Extension(pool): Extension<Pool>,
) -> WebResult<impl IntoResponse> {
) -> AxumResult<impl IntoResponse> {
releases_handler(pool, page.map(|p| p.0), ReleaseType::Failures).await
}

Expand Down
6 changes: 3 additions & 3 deletions src/web/sitemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{
impl_axum_webpage, impl_webpage,
utils::{get_config, spawn_blocking, ConfigName},
web::{
error::{AxumNope, WebResult},
error::{AxumNope, AxumResult},
page::WebPage,
},
};
Expand Down Expand Up @@ -54,7 +54,7 @@ impl_axum_webpage! {
pub(crate) async fn sitemap_handler(
Path(letter): Path<String>,
Extension(pool): Extension<Pool>,
) -> WebResult<impl IntoResponse> {
) -> AxumResult<impl IntoResponse> {
if letter.len() != 1 {
return Err(AxumNope::ResourceNotFound);
} else if let Some(ch) = letter.chars().next() {
Expand Down Expand Up @@ -112,7 +112,7 @@ impl_axum_webpage!(AboutBuilds = "core/about/builds.html");

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

0 comments on commit 83ad0bb

Please sign in to comment.