@@ -42,10 +42,14 @@ fn main() {
42
42
let version = args
43
43
. next ( )
44
44
. expect ( "A version number (xx.yy.zz) for the Rust release is required." ) ;
45
- let today = Utc :: now ( ) . date ( ) ;
45
+ let today = Utc :: now ( ) . date_naive ( ) ;
46
46
47
47
// A known rust release date. (1.42.0)
48
- let mut end = Utc . ymd ( 2020 , 3 , 12 ) ;
48
+ let mut end = Utc
49
+ . with_ymd_and_hms ( 2020 , 3 , 12 , 0 , 0 , 0 )
50
+ . single ( )
51
+ . unwrap ( )
52
+ . date_naive ( ) ;
49
53
let six_weeks = Duration :: weeks ( 6 ) ;
50
54
51
55
// Get the most recent rust release date.
@@ -126,17 +130,20 @@ fn main() {
126
130
}
127
131
128
132
eprintln ! (
129
- "Did not use {:?} from {} <{}>" ,
133
+ "Did not use {:?} from {} <{}> (intended to provide relnotes for: {:?}) " ,
130
134
section,
131
135
issue. raw[ "title" ] . as_str( ) . unwrap( ) ,
132
- issue. raw[ "url" ] . as_str( ) . unwrap( )
136
+ issue. raw[ "url" ] . as_str( ) . unwrap( ) ,
137
+ issues
138
+ . iter( )
139
+ . find( |i| i[ "number" ] . as_u64( ) . unwrap( ) == issue. for_number)
133
140
) ;
134
141
}
135
142
}
136
143
137
144
let relnotes = ReleaseNotes {
138
145
version,
139
- date : ( end + six_weeks) . naive_utc ( ) ,
146
+ date : end + six_weeks,
140
147
141
148
language_relnotes,
142
149
compiler_relnotes,
@@ -282,6 +289,7 @@ struct TrackingIssues {
282
289
283
290
#[ derive( Debug ) ]
284
291
struct TrackingIssue {
292
+ for_number : u64 ,
285
293
raw : json:: Value ,
286
294
// Section name -> (used, lines)
287
295
sections : HashMap < String , ( bool , Vec < String > ) > ,
@@ -331,6 +339,7 @@ impl TrackingIssues {
331
339
tracking_issues. insert (
332
340
for_number,
333
341
TrackingIssue {
342
+ for_number,
334
343
raw : o. clone ( ) ,
335
344
sections,
336
345
} ,
@@ -362,7 +371,10 @@ fn map_to_line_items<'a>(
362
371
}
363
372
364
373
for ( section, ( used, lines) ) in issue. sections . iter_mut ( ) {
365
- if let Some ( contents) = by_section. get_mut ( section. as_str ( ) ) {
374
+ if let Some ( ( _, contents) ) = by_section
375
+ . iter_mut ( )
376
+ . find ( |( s, _) | s. eq_ignore_ascii_case ( section) )
377
+ {
366
378
* used = true ;
367
379
for line in lines. iter ( ) {
368
380
contents. push_str ( line) ;
0 commit comments