Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

Slightly more precise error

+11 -7
+11 -7
compiler-core/src/tests.rs
··· 59 59 #[test] 60 60 fn rust_advisories_ignore_deadlines() { 61 61 let today = time::OffsetDateTime::now_utc().date(); 62 - let regex = regex::Regex::new(r"(?m)^FIX-DEADLINE:\s*(\d{4})-(\d{2})-(\d{2})$").unwrap(); 62 + let regex = regex::Regex::new(r"(?m)FIX-DEADLINE: (\d{4})-(\d{2})-(\d{2})").unwrap(); 63 63 64 64 for ignored in load_cargo_deny_config().advisories.ignore { 65 65 let id = ignored.id; 66 - let Some(deadline) = regex.captures(&ignored.reason).and_then(|caps| { 67 - let year = caps[1].parse::<i32>().ok()?; 68 - let month = caps[2].parse::<u8>().ok()?; 69 - let day = caps[3].parse::<u8>().ok()?; 70 - time::Date::from_calendar_date(year, month.try_into().ok()?, day).ok() 71 - }) else { 66 + let reason = ignored.reason; 67 + let Some(captures) = regex.captures(&reason) else { 72 68 panic!( 73 69 " 74 70 deny.toml advisory missing deadline! 75 71 Add a line to the `reason` property for {id} with this format: 76 72 77 73 FIX-DEADLINE: 2026-01-05 74 + 75 + {reason:?} 78 76 " 79 77 ) 80 78 }; 79 + 80 + let year = captures[1].parse::<i32>().expect("parse year"); 81 + let month = captures[2].parse::<u8>().expect("parse month int"); 82 + let month = month.try_into().expect("parse month"); 83 + let day = captures[3].parse::<u8>().expect("parse day"); 84 + let deadline = time::Date::from_calendar_date(year, month, day).expect("construct date"); 81 85 82 86 assert!( 83 87 today <= deadline,