diff --git a/src/main.rs b/src/main.rs index a8667227..2975b898 100644 --- a/src/main.rs +++ b/src/main.rs @@ -223,7 +223,7 @@ async fn team( section: &str, team: &str, teams_cache: &Cache, -) -> Result> { +) -> Result { render_team(section, team, ENGLISH.into(), teams_cache).await } @@ -241,7 +241,7 @@ async fn team_locale( team: &str, locale: SupportedLocale, teams_cache: &Cache, -) -> Result> { +) -> Result { render_team(section, team, locale.0, teams_cache).await } @@ -440,7 +440,7 @@ async fn render_team( team: &str, lang: String, teams_cache: &Cache, -) -> Result> { +) -> Result { match teams::page_data(section, team, teams_cache).await { Ok(data) => { let page = "governance/group"; @@ -450,16 +450,10 @@ async fn render_team( } Err(err) => { if err.is::() { - match (section, team) { - // Old teams URLs - ("teams", "language-and-compiler") | ("teams", "operations") => { - Err(Ok(Redirect::temporary("/governance"))) - } - _ => Err(Err(Status::NotFound)), - } + Err(Status::NotFound) } else { eprintln!("error while loading the team page: {}", err); - Err(Err(Status::InternalServerError)) + Err(Status::InternalServerError) } } } diff --git a/src/redirect.rs b/src/redirect.rs index eca98204..b964103b 100644 --- a/src/redirect.rs +++ b/src/redirect.rs @@ -33,6 +33,8 @@ static PAGE_REDIRECTS: &[(&str, &str)] = &[ "governance/teams/crates-io", "governance/teams/dev-tools#team-crates-io", ), + ("governance/teams/language-and-compiler", "governance#teams"), + ("governance/teams/operations", "governance#teams"), // miscellaneous ("governance/teams", "governance#teams"), ];