diff --git a/Cargo.lock b/Cargo.lock index d1c8539b..77f7eeac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1832,7 +1832,7 @@ dependencies = [ [[package]] name = "rust_team_data" version = "1.0.0" -source = "git+https://github.com/rust-lang/team#651fb3f9c64c934c9073472765d745a606dd9daf" +source = "git+https://github.com/rust-lang/team#e86e4d27cc5598c1d85b14d3094bb98c439facae" dependencies = [ "indexmap", "serde", @@ -2006,18 +2006,18 @@ checksum = "c2fdfc24bc566f839a2da4c4295b82db7d25a24253867d5c64355abb5799bdbe" [[package]] name = "serde" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" dependencies = [ "proc-macro2", "quote", @@ -2026,9 +2026,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.138" +version = "1.0.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" dependencies = [ "itoa", "memchr", @@ -2400,9 +2400,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" dependencies = [ "serde", "serde_spanned", @@ -2421,9 +2421,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap", "serde", @@ -3017,9 +3017,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.20" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1" dependencies = [ "memchr", ] diff --git a/src/teams.rs b/src/teams.rs index c6ef76b5..a7179205 100644 --- a/src/teams.rs +++ b/src/teams.rs @@ -61,14 +61,9 @@ impl Data { self.teams .into_iter() .filter(|team| team.website_data.is_some()) - // On the main page, show the leadership-council, all top-level + // On the main page, show the leadership-council and all top-level // teams. - .filter(|team| { - matches!( - team.subteam_of.as_deref(), - None | Some("leadership-council") - ) - }) + .filter(|team| team.kind == TeamKind::Team && team.subteam_of.is_none()) .map(|team| IndexTeam { url: format!( "{}/{}", @@ -77,11 +72,7 @@ impl Data { ), team, }) - .for_each(|team| { - if team.team.kind == TeamKind::Team { - data.teams.push(team) - } - }); + .for_each(|team| data.teams.push(team)); data.teams.sort_by_key(|index_team| { Reverse(index_team.team.website_data.as_ref().unwrap().weight) @@ -105,11 +96,14 @@ impl Data { // Don't show pages for subteams if let Some(subteam) = &main_team.subteam_of { - // Each launching-pad and leadership-council subteam has their own - // page. Subteams of those subteams do not get a page of their own - // (they are shown in their parent page). We may want to consider - // putting launching-pad teams into a separate page in the future. - if !matches!(subteam.as_ref(), "launching-pad" | "leadership-council") { + // In the past we gave working groups their own dedicated pages linked + // from the front page. We have now moved those working groups under + // launching-pad, and the groups are listed as subteams of the launching + // pad. To avoid breaking external links to things like + // https://www.rust-lang.org/governance/wgs/wg-secure-code, + // we still generate dedicated pages for these launching-pad teams, + // but they are not linked from the main site. + if !matches!(subteam.as_ref(), "launching-pad") { return Err(TeamNotFound.into()); } } @@ -122,35 +116,27 @@ impl Data { let superteams: HashMap<_, _> = self .teams .iter() - .filter(|team| matches!(team.kind, TeamKind::Team)) .filter_map(|team| Some((team.name.clone(), team.subteam_of.clone()?))) .collect(); self.teams .into_iter() - // The leadership-council page should show just the - // leadership-council, not everything underneath it. - .filter(|_| main_team.name != "leadership-council") .filter(|team| team.website_data.is_some()) .filter(|team| { // For teams find not only direct subteams but also transitive ones. - if let TeamKind::Team = team.kind { - let mut team = &team.name; - - // The graph of teams is guaranteed to be acyclic by the CI script of - // the team repository. Therefore this loop has to terminate eventually. - while let Some(superteam) = superteams.get(team) { - if superteam == &main_team.name { - return true; - } + let mut team = &team.name; - team = superteam; + // The graph of teams is guaranteed to be acyclic by the CI script of + // the team repository. Therefore this loop has to terminate eventually. + while let Some(superteam) = superteams.get(team) { + if superteam == &main_team.name { + return true; } - return false; + team = superteam; } - team.subteam_of.as_ref() == Some(&main_team.name) + false }) .for_each(|team| match team.kind { TeamKind::Team => raw_subteams.push(team),