@@ -16,6 +16,22 @@ pub struct Generator {
16
16
seen : BTreeSet < String > ,
17
17
}
18
18
19
+ fn shorten ( url : & str ) -> String {
20
+ if let Some ( num) = url. strip_prefix ( "https://github.com/rust-lang/rust/issues/" ) {
21
+ format ! ( "rust.tf/{num}" )
22
+ } else if let Some ( num) = url. strip_prefix ( "https://github.com/rust-lang/rust/pull/" ) {
23
+ format ! ( "rust.tf/{num}" )
24
+ } else if let Some ( num) = url. strip_prefix ( "https://github.com/rust-lang/rfcs/issues/" ) {
25
+ format ! ( "rust.tf/rfc{num}" )
26
+ } else if let Some ( num) = url. strip_prefix ( "https://github.com/rust-lang/rfcs/pull/" ) {
27
+ format ! ( "rust.tf/rfc{num}" )
28
+ } else if let Some ( url) = url. strip_prefix ( "https://" ) {
29
+ url. to_string ( )
30
+ } else {
31
+ url. to_string ( )
32
+ }
33
+ }
34
+
19
35
impl Generator {
20
36
pub fn libs_api_agenda ( mut self ) -> Result < String > {
21
37
writeln ! (
@@ -309,27 +325,26 @@ impl Generator {
309
325
310
326
writeln ! ( self . agenda, "### FCPs" ) ?;
311
327
writeln ! ( self . agenda, ) ?;
312
- writeln ! ( self . agenda, "{} open {} FCPs:" , fcps. len( ) , label) ?;
313
328
314
329
for repo in repos {
315
330
let fcps = fcps
316
331
. iter ( )
317
332
. filter ( |fcp| fcp. issue . repository == repo)
318
333
. collect :: < Vec < _ > > ( ) ;
319
334
320
- writeln ! ( self . agenda, "<details><summary><a href=\" https://github.com/{}/issues?q=is%3Aopen+label%3AT-libs-api+label%3Aproposed-final-comment-period\" >{} <code>{}</code> FCPs</a></summary>\n " , repo, fcps. len( ) , repo) ?;
335
+ //writeln!(self.agenda, "<details><summary><a href=\"https://github.com/{}/issues?q=is%3Aopen+label%3AT-libs-api+label%3Aproposed-final-comment-period\">{} <code>{}</code> FCPs</a></summary>\n", repo, fcps.len(), repo)?;
336
+
337
+ writeln ! ( self . agenda, "{} {} {} FCPs\n " , fcps. len( ) , repo, label) ?;
321
338
322
339
for fcp in fcps {
323
- let url = format ! (
324
- "https://github.com/{}/issues/{}#issuecomment-{}" ,
325
- fcp. issue. repository, fcp. issue. number, fcp. status_comment. id
326
- ) ;
340
+ let url = shorten ( & format ! (
341
+ "https://github.com/{}/issues/{}" , // #issuecomment-{}",
342
+ fcp. issue. repository, fcp. issue. number, // fcp.status_comment.id
343
+ ) ) ;
327
344
write ! (
328
345
self . agenda,
329
- " - [[ {} {}]({})] *{}*" ,
346
+ " - {} {url} *{}*" ,
330
347
fcp. fcp. disposition,
331
- fcp. issue. number,
332
- url,
333
348
escape( & fcp. issue. title)
334
349
) ?;
335
350
let needed = fcp. reviews . iter ( ) . filter ( |review| !review. 1 ) . count ( ) ;
@@ -340,10 +355,12 @@ impl Generator {
340
355
// writeln!(self.agenda, " Blocked on an open concern.")?;
341
356
// }
342
357
}
343
- writeln ! ( self . agenda, "</details>" ) ?;
358
+
359
+ writeln ! ( self . agenda) ?;
360
+ //writeln!(self.agenda, "</details>")?;
344
361
}
345
362
346
- writeln ! ( self . agenda, "<p></p>\n " ) ?;
363
+ // writeln!(self.agenda, "<p></p>\n")?;
347
364
348
365
for ( i, ( & reviewer, & num) ) in reviewer_count. iter ( ) . enumerate ( ) {
349
366
if i != 0 {
@@ -363,7 +380,7 @@ impl Generator {
363
380
364
381
fn write_issues ( & mut self , issues : & [ Issue ] ) -> Result < ( ) > {
365
382
for issue in issues. iter ( ) . rev ( ) {
366
- write ! ( self . agenda, " - [[{}]({})] " , issue. number , issue . html_url, ) ?;
383
+ write ! ( self . agenda, " - {} " , shorten ( & issue. html_url) ) ?;
367
384
for label in issue. labels . iter ( ) . filter ( |s| s. starts_with ( "P-" ) ) {
368
385
write ! ( self . agenda, " `{}`" , label) ?;
369
386
}
0 commit comments