Skip to content

Commit cd3ef7d

Browse files
authored
Merge pull request #2116 from rust-lang/master
Deploy
2 parents 0ba12d2 + 0e67364 commit cd3ef7d

File tree

2 files changed

+32
-46
lines changed

2 files changed

+32
-46
lines changed

Cargo.lock

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/teams.rs

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,9 @@ impl Data {
6161
self.teams
6262
.into_iter()
6363
.filter(|team| team.website_data.is_some())
64-
// On the main page, show the leadership-council, all top-level
64+
// On the main page, show the leadership-council and all top-level
6565
// teams.
66-
.filter(|team| {
67-
matches!(
68-
team.subteam_of.as_deref(),
69-
None | Some("leadership-council")
70-
)
71-
})
66+
.filter(|team| team.kind == TeamKind::Team && team.subteam_of.is_none())
7267
.map(|team| IndexTeam {
7368
url: format!(
7469
"{}/{}",
@@ -77,11 +72,7 @@ impl Data {
7772
),
7873
team,
7974
})
80-
.for_each(|team| {
81-
if team.team.kind == TeamKind::Team {
82-
data.teams.push(team)
83-
}
84-
});
75+
.for_each(|team| data.teams.push(team));
8576

8677
data.teams.sort_by_key(|index_team| {
8778
Reverse(index_team.team.website_data.as_ref().unwrap().weight)
@@ -105,11 +96,14 @@ impl Data {
10596

10697
// Don't show pages for subteams
10798
if let Some(subteam) = &main_team.subteam_of {
108-
// Each launching-pad and leadership-council subteam has their own
109-
// page. Subteams of those subteams do not get a page of their own
110-
// (they are shown in their parent page). We may want to consider
111-
// putting launching-pad teams into a separate page in the future.
112-
if !matches!(subteam.as_ref(), "launching-pad" | "leadership-council") {
99+
// In the past we gave working groups their own dedicated pages linked
100+
// from the front page. We have now moved those working groups under
101+
// launching-pad, and the groups are listed as subteams of the launching
102+
// pad. To avoid breaking external links to things like
103+
// https://www.rust-lang.org/governance/wgs/wg-secure-code,
104+
// we still generate dedicated pages for these launching-pad teams,
105+
// but they are not linked from the main site.
106+
if !matches!(subteam.as_ref(), "launching-pad") {
113107
return Err(TeamNotFound.into());
114108
}
115109
}
@@ -122,35 +116,27 @@ impl Data {
122116
let superteams: HashMap<_, _> = self
123117
.teams
124118
.iter()
125-
.filter(|team| matches!(team.kind, TeamKind::Team))
126119
.filter_map(|team| Some((team.name.clone(), team.subteam_of.clone()?)))
127120
.collect();
128121

129122
self.teams
130123
.into_iter()
131-
// The leadership-council page should show just the
132-
// leadership-council, not everything underneath it.
133-
.filter(|_| main_team.name != "leadership-council")
134124
.filter(|team| team.website_data.is_some())
135125
.filter(|team| {
136126
// For teams find not only direct subteams but also transitive ones.
137-
if let TeamKind::Team = team.kind {
138-
let mut team = &team.name;
139-
140-
// The graph of teams is guaranteed to be acyclic by the CI script of
141-
// the team repository. Therefore this loop has to terminate eventually.
142-
while let Some(superteam) = superteams.get(team) {
143-
if superteam == &main_team.name {
144-
return true;
145-
}
127+
let mut team = &team.name;
146128

147-
team = superteam;
129+
// The graph of teams is guaranteed to be acyclic by the CI script of
130+
// the team repository. Therefore this loop has to terminate eventually.
131+
while let Some(superteam) = superteams.get(team) {
132+
if superteam == &main_team.name {
133+
return true;
148134
}
149135

150-
return false;
136+
team = superteam;
151137
}
152138

153-
team.subteam_of.as_ref() == Some(&main_team.name)
139+
false
154140
})
155141
.for_each(|team| match team.kind {
156142
TeamKind::Team => raw_subteams.push(team),

0 commit comments

Comments
 (0)