@@ -61,14 +61,9 @@ impl Data {
61
61
self . teams
62
62
. into_iter ( )
63
63
. 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
65
65
// 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 ( ) )
72
67
. map ( |team| IndexTeam {
73
68
url : format ! (
74
69
"{}/{}" ,
@@ -77,11 +72,7 @@ impl Data {
77
72
) ,
78
73
team,
79
74
} )
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) ) ;
85
76
86
77
data. teams . sort_by_key ( |index_team| {
87
78
Reverse ( index_team. team . website_data . as_ref ( ) . unwrap ( ) . weight )
@@ -105,11 +96,14 @@ impl Data {
105
96
106
97
// Don't show pages for subteams
107
98
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" ) {
113
107
return Err ( TeamNotFound . into ( ) ) ;
114
108
}
115
109
}
@@ -122,35 +116,27 @@ impl Data {
122
116
let superteams: HashMap < _ , _ > = self
123
117
. teams
124
118
. iter ( )
125
- . filter ( |team| matches ! ( team. kind, TeamKind :: Team ) )
126
119
. filter_map ( |team| Some ( ( team. name . clone ( ) , team. subteam_of . clone ( ) ?) ) )
127
120
. collect ( ) ;
128
121
129
122
self . teams
130
123
. 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" )
134
124
. filter ( |team| team. website_data . is_some ( ) )
135
125
. filter ( |team| {
136
126
// 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 ;
146
128
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 ;
148
134
}
149
135
150
- return false ;
136
+ team = superteam ;
151
137
}
152
138
153
- team . subteam_of . as_ref ( ) == Some ( & main_team . name )
139
+ false
154
140
} )
155
141
. for_each ( |team| match team. kind {
156
142
TeamKind :: Team => raw_subteams. push ( team) ,
0 commit comments