use std::collections::HashMap;
use std::sync::LazyLock;
use const_format::formatcp;
use ordered_float::OrderedFloat;
use url::Url;
use crate::jolpica::{
response::*,
time::{
Date, DateTime, QualifyingTime, RaceTime, duration_m_s_ms, duration_millis, duration_s_ms,
macros::{date, time},
},
};
pub(crate) const SEASON_1950_STR: &str = r#"{
"season": "1950",
"url": "https://en.wikipedia.org/wiki/1950_Formula_One_season"
}"#;
pub(crate) const SEASON_1979_STR: &str = r#"{
"season": "1979",
"url": "https://en.wikipedia.org/wiki/1979_Formula_One_season"
}"#;
pub(crate) const SEASON_1980_STR: &str = r#"{
"season": "1980",
"url": "https://en.wikipedia.org/wiki/1980_Formula_One_season"
}"#;
pub(crate) const SEASON_1981_STR: &str = r#"{
"season": "1981",
"url": "https://en.wikipedia.org/wiki/1981_Formula_One_World_Championship"
}"#;
pub(crate) const SEASON_2000_STR: &str = r#"{
"season": "2000",
"url": "https://en.wikipedia.org/wiki/2000_Formula_One_World_Championship"
}"#;
pub(crate) const SEASON_2023_STR: &str = r#"{
"season": "2023",
"url": "https://en.wikipedia.org/wiki/2023_Formula_One_World_Championship"
}"#;
pub(crate) static SEASON_1950: LazyLock<Season> = LazyLock::new(|| Season {
season: 1950,
url: Url::parse("https://en.wikipedia.org/wiki/1950_Formula_One_season").unwrap(),
});
pub(crate) static SEASON_1979: LazyLock<Season> = LazyLock::new(|| Season {
season: 1979,
url: Url::parse("https://en.wikipedia.org/wiki/1979_Formula_One_season").unwrap(),
});
pub(crate) static SEASON_1980: LazyLock<Season> = LazyLock::new(|| Season {
season: 1980,
url: Url::parse("https://en.wikipedia.org/wiki/1980_Formula_One_season").unwrap(),
});
pub(crate) static SEASON_1981: LazyLock<Season> = LazyLock::new(|| Season {
season: 1981,
url: Url::parse("https://en.wikipedia.org/wiki/1981_Formula_One_World_Championship").unwrap(),
});
pub(crate) static SEASON_2000: LazyLock<Season> = LazyLock::new(|| Season {
season: 2000,
url: Url::parse("https://en.wikipedia.org/wiki/2000_Formula_One_World_Championship").unwrap(),
});
pub(crate) static SEASON_2023: LazyLock<Season> = LazyLock::new(|| Season {
season: 2023,
url: Url::parse("https://en.wikipedia.org/wiki/2023_Formula_One_World_Championship").unwrap(),
});
pub(crate) const SEASON_TABLE_STR: &str = formatcp!(
r#"{{
"SeasonTable": {{
"Seasons": [
{SEASON_1950_STR},
{SEASON_1979_STR},
{SEASON_1980_STR},
{SEASON_1981_STR},
{SEASON_2000_STR},
{SEASON_2023_STR}
]
}}}}"#
);
pub(crate) static SEASON_TABLE: LazyLock<Table> = LazyLock::new(|| Table::Seasons {
seasons: vec![
SEASON_1950.clone(),
SEASON_1979.clone(),
SEASON_1980.clone(),
SEASON_1981.clone(),
SEASON_2000.clone(),
SEASON_2023.clone(),
],
});
pub(crate) const DRIVER_FANGIO_STR: &str = r#"{
"driverId": "fangio",
"url": "http://en.wikipedia.org/wiki/Juan_Manuel_Fangio",
"givenName": "Juan",
"familyName": "Fangio",
"dateOfBirth": "1911-06-24",
"nationality": "Argentine"
}"#;
pub(crate) const DRIVER_HAILWOOD_STR: &str = r#"{
"driverId": "hailwood",
"url": "http://en.wikipedia.org/wiki/Mike_Hailwood",
"givenName": "Mike",
"familyName": "Hailwood",
"dateOfBirth": "1940-04-02",
"nationality": "British"
}"#;
pub(crate) const DRIVER_ABATE_STR: &str = r#"{
"driverId": "abate",
"url": "http://en.wikipedia.org/wiki/Carlo_Mario_Abate",
"givenName": "Carlo",
"familyName": "Abate",
"dateOfBirth": "1932-07-10",
"nationality": "Italian"
}"#;
pub(crate) const DRIVER_MICHAEL_STR: &str = r#"{
"driverId": "michael_schumacher",
"code": "MSC",
"url": "http://en.wikipedia.org/wiki/Michael_Schumacher",
"givenName": "Michael",
"familyName": "Schumacher",
"dateOfBirth": "1969-01-03",
"nationality": "German"
}"#;
pub(crate) const DRIVER_JOS_STR: &str = r#"{
"driverId": "verstappen",
"url": "http://en.wikipedia.org/wiki/Jos_Verstappen",
"givenName": "Jos",
"familyName": "Verstappen",
"dateOfBirth": "1972-03-04",
"nationality": "Dutch"
}"#;
pub(crate) const DRIVER_RALF_STR: &str = r#"{
"driverId": "ralf_schumacher",
"code": "SCH",
"url": "http://en.wikipedia.org/wiki/Ralf_Schumacher",
"givenName": "Ralf",
"familyName": "Schumacher",
"dateOfBirth": "1975-06-30",
"nationality": "German"
}"#;
pub(crate) const DRIVER_WILSON_STR: &str = r#"{
"driverId": "wilson",
"url": "http://en.wikipedia.org/wiki/Justin_Wilson_(racing_driver)",
"givenName": "Justin",
"familyName": "Wilson",
"dateOfBirth": "1978-07-31",
"nationality": "British"
}"#;
pub(crate) const DRIVER_KIMI_STR: &str = r#"{
"driverId": "raikkonen",
"permanentNumber": "7",
"code": "RAI",
"url": "http://en.wikipedia.org/wiki/Kimi_R%C3%A4ikk%C3%B6nen",
"givenName": "Kimi",
"familyName": "Räikkönen",
"dateOfBirth": "1979-10-17",
"nationality": "Finnish"
}"#;
pub(crate) const DRIVER_ALONSO_STR: &str = r#"{
"driverId": "alonso",
"permanentNumber": "14",
"code": "ALO",
"url": "http://en.wikipedia.org/wiki/Fernando_Alonso",
"givenName": "Fernando",
"familyName": "Alonso",
"dateOfBirth": "1981-07-29",
"nationality": "Spanish"
}"#;
pub(crate) const DRIVER_HAMILTON_STR: &str = r#"{
"driverId": "hamilton",
"permanentNumber": "44",
"code": "HAM",
"url": "http://en.wikipedia.org/wiki/Lewis_Hamilton",
"givenName": "Lewis",
"familyName": "Hamilton",
"dateOfBirth": "1985-01-07",
"nationality": "British"
}"#;
pub(crate) const DRIVER_PEREZ_STR: &str = r#"{
"driverId": "perez",
"permanentNumber": "11",
"code": "PER",
"url": "http://en.wikipedia.org/wiki/Sergio_P%C3%A9rez",
"givenName": "Sergio",
"familyName": "Pérez",
"dateOfBirth": "1990-01-26",
"nationality": "Mexican"
}"#;
pub(crate) const DRIVER_SAINZ_STR: &str = r#"{
"driverId": "sainz",
"permanentNumber": "55",
"code": "SAI",
"url": "http://en.wikipedia.org/wiki/Carlos_Sainz_Jr.",
"givenName": "Carlos",
"familyName": "Sainz",
"dateOfBirth": "1994-09-01",
"nationality": "Spanish"
}"#;
pub(crate) const DRIVER_DE_VRIES_STR: &str = r#"{
"driverId": "de_vries",
"permanentNumber": "21",
"code": "DEV",
"url": "http://en.wikipedia.org/wiki/Nyck_de_Vries",
"givenName": "Nyck",
"familyName": "de Vries",
"dateOfBirth": "1995-02-06",
"nationality": "Dutch"
}"#;
pub(crate) const DRIVER_MAX_STR: &str = r#"{
"driverId": "max_verstappen",
"permanentNumber": "33",
"code": "VER",
"url": "http://en.wikipedia.org/wiki/Max_Verstappen",
"givenName": "Max",
"familyName": "Verstappen",
"dateOfBirth": "1997-09-30",
"nationality": "Dutch"
}"#;
pub(crate) const DRIVER_LECLERC_STR: &str = r#"{
"driverId": "leclerc",
"permanentNumber": "16",
"code": "LEC",
"url": "http://en.wikipedia.org/wiki/Charles_Leclerc",
"givenName": "Charles",
"familyName": "Leclerc",
"dateOfBirth": "1997-10-16",
"nationality": "Monegasque"
}"#;
pub(crate) const DRIVER_RUSSELL_STR: &str = r#"{
"driverId": "russell",
"permanentNumber": "63",
"code": "RUS",
"url": "http://en.wikipedia.org/wiki/George_Russell_(racing_driver)",
"givenName": "George",
"familyName": "Russell",
"dateOfBirth": "1998-02-15",
"nationality": "British"
}"#;
pub(crate) static DRIVER_FANGIO: LazyLock<Driver> = LazyLock::new(|| Driver {
driver_id: "fangio".into(),
permanent_number: None,
code: None,
url: Url::parse("http://en.wikipedia.org/wiki/Juan_Manuel_Fangio").unwrap(),
given_name: "Juan".to_string(),
family_name: "Fangio".to_string(),
date_of_birth: date!(1911 - 06 - 24),
nationality: "Argentine".to_string(),
});
pub(crate) static DRIVER_HAILWOOD: LazyLock<Driver> = LazyLock::new(|| Driver {
driver_id: "hailwood".into(),
permanent_number: None,
code: None,
url: Url::parse("http://en.wikipedia.org/wiki/Mike_Hailwood").unwrap(),
given_name: "Mike".to_string(),
family_name: "Hailwood".to_string(),
date_of_birth: date!(1940 - 04 - 02),
nationality: "British".to_string(),
});
pub(crate) static DRIVER_ABATE: LazyLock<Driver> = LazyLock::new(|| Driver {
driver_id: "abate".into(),
permanent_number: None,
code: None,
url: Url::parse("http://en.wikipedia.org/wiki/Carlo_Mario_Abate").unwrap(),
given_name: "Carlo".to_string(),
family_name: "Abate".to_string(),
date_of_birth: date!(1932 - 07 - 10),
nationality: "Italian".to_string(),
});
pub(crate) static DRIVER_MICHAEL: LazyLock<Driver> = LazyLock::new(|| Driver {
driver_id: "michael_schumacher".into(),
permanent_number: None,
code: Some("MSC".to_string()),
url: Url::parse("http://en.wikipedia.org/wiki/Michael_Schumacher").unwrap(),
given_name: "Michael".to_string(),
family_name: "Schumacher".to_string(),
date_of_birth: date!(1969 - 01 - 03),
nationality: "German".to_string(),
});
pub(crate) static DRIVER_JOS: LazyLock<Driver> = LazyLock::new(|| Driver {
driver_id: "verstappen".into(),
permanent_number: None,
code: None,
url: Url::parse("http://en.wikipedia.org/wiki/Jos_Verstappen").unwrap(),
given_name: "Jos".to_string(),
family_name: "Verstappen".to_string(),
date_of_birth: date!(1972 - 03 - 04),
nationality: "Dutch".to_string(),
});
pub(crate) static DRIVER_RALF: LazyLock<Driver> = LazyLock::new(|| Driver {
driver_id: "ralf_schumacher".into(),
permanent_number: None,
code: Some("SCH".to_string()),
url: Url::parse("http://en.wikipedia.org/wiki/Ralf_Schumacher").unwrap(),
given_name: "Ralf".to_string(),
family_name: "Schumacher".to_string(),
date_of_birth: date!(1975 - 06 - 30),
nationality: "German".to_string(),
});
pub(crate) static DRIVER_WILSON: LazyLock<Driver> = LazyLock::new(|| Driver {
driver_id: "wilson".into(),
permanent_number: None,
code: None,
url: Url::parse("http://en.wikipedia.org/wiki/Justin_Wilson_(racing_driver)").unwrap(),
given_name: "Justin".to_string(),
family_name: "Wilson".to_string(),
date_of_birth: date!(1978 - 07 - 31),
nationality: "British".to_string(),
});
pub(crate) static DRIVER_KIMI: LazyLock<Driver> = LazyLock::new(|| Driver {
driver_id: "raikkonen".into(),
permanent_number: Some(7),
code: Some("RAI".to_string()),
url: Url::parse("http://en.wikipedia.org/wiki/Kimi_R%C3%A4ikk%C3%B6nen").unwrap(),
given_name: "Kimi".to_string(),
family_name: "Räikkönen".to_string(),
date_of_birth: date!(1979 - 10 - 17),
nationality: "Finnish".to_string(),
});
pub(crate) static DRIVER_ALONSO: LazyLock<Driver> = LazyLock::new(|| Driver {
driver_id: "alonso".into(),
permanent_number: Some(14),
code: Some("ALO".to_string()),
url: Url::parse("http://en.wikipedia.org/wiki/Fernando_Alonso").unwrap(),
given_name: "Fernando".to_string(),
family_name: "Alonso".to_string(),
date_of_birth: date!(1981 - 07 - 29),
nationality: "Spanish".to_string(),
});
pub(crate) static DRIVER_HAMILTON: LazyLock<Driver> = LazyLock::new(|| Driver {
driver_id: "hamilton".into(),
permanent_number: Some(44),
code: Some("HAM".to_string()),
url: Url::parse("http://en.wikipedia.org/wiki/Lewis_Hamilton").unwrap(),
given_name: "Lewis".to_string(),
family_name: "Hamilton".to_string(),
date_of_birth: date!(1985 - 01 - 07),
nationality: "British".to_string(),
});
pub(crate) static DRIVER_PEREZ: LazyLock<Driver> = LazyLock::new(|| Driver {
driver_id: "perez".into(),
permanent_number: Some(11),
code: Some("PER".to_string()),
url: Url::parse("http://en.wikipedia.org/wiki/Sergio_P%C3%A9rez").unwrap(),
given_name: "Sergio".to_string(),
family_name: "Pérez".to_string(),
date_of_birth: date!(1990 - 01 - 26),
nationality: "Mexican".to_string(),
});
pub(crate) static DRIVER_SAINZ: LazyLock<Driver> = LazyLock::new(|| Driver {
driver_id: "sainz".into(),
permanent_number: Some(55),
code: Some("SAI".to_string()),
url: Url::parse("http://en.wikipedia.org/wiki/Carlos_Sainz_Jr.").unwrap(),
given_name: "Carlos".to_string(),
family_name: "Sainz".to_string(),
date_of_birth: date!(1994 - 09 - 01),
nationality: "Spanish".to_string(),
});
pub(crate) static DRIVER_DE_VRIES: LazyLock<Driver> = LazyLock::new(|| Driver {
driver_id: "de_vries".into(),
permanent_number: Some(21),
code: Some("DEV".to_string()),
url: Url::parse("http://en.wikipedia.org/wiki/Nyck_de_Vries").unwrap(),
given_name: "Nyck".to_string(),
family_name: "de Vries".to_string(),
date_of_birth: date!(1995 - 02 - 06),
nationality: "Dutch".to_string(),
});
pub(crate) static DRIVER_MAX: LazyLock<Driver> = LazyLock::new(|| Driver {
driver_id: "max_verstappen".into(),
permanent_number: Some(33),
code: Some("VER".to_string()),
url: Url::parse("http://en.wikipedia.org/wiki/Max_Verstappen").unwrap(),
given_name: "Max".to_string(),
family_name: "Verstappen".to_string(),
date_of_birth: date!(1997 - 09 - 30),
nationality: "Dutch".to_string(),
});
pub(crate) static DRIVER_LECLERC: LazyLock<Driver> = LazyLock::new(|| Driver {
driver_id: "leclerc".into(),
permanent_number: Some(16),
code: Some("LEC".to_string()),
url: Url::parse("http://en.wikipedia.org/wiki/Charles_Leclerc").unwrap(),
given_name: "Charles".to_string(),
family_name: "Leclerc".to_string(),
date_of_birth: date!(1997 - 10 - 16),
nationality: "Monegasque".to_string(),
});
pub(crate) static DRIVER_RUSSELL: LazyLock<Driver> = LazyLock::new(|| Driver {
driver_id: "russell".into(),
permanent_number: Some(63),
code: Some("RUS".to_string()),
url: Url::parse("http://en.wikipedia.org/wiki/George_Russell_(racing_driver)").unwrap(),
given_name: "George".to_string(),
family_name: "Russell".to_string(),
date_of_birth: date!(1998 - 02 - 15),
nationality: "British".to_string(),
});
pub(crate) const DRIVER_TABLE_STR: &str = formatcp!(
r#"{{
"DriverTable": {{
"Drivers": [
{DRIVER_FANGIO_STR},
{DRIVER_HAILWOOD_STR},
{DRIVER_ABATE_STR},
{DRIVER_MICHAEL_STR},
{DRIVER_JOS_STR},
{DRIVER_RALF_STR},
{DRIVER_WILSON_STR},
{DRIVER_KIMI_STR},
{DRIVER_ALONSO_STR},
{DRIVER_HAMILTON_STR},
{DRIVER_PEREZ_STR},
{DRIVER_SAINZ_STR},
{DRIVER_DE_VRIES_STR},
{DRIVER_MAX_STR},
{DRIVER_LECLERC_STR},
{DRIVER_RUSSELL_STR}
]
}}}}"#
);
pub(crate) static DRIVER_TABLE: LazyLock<Table> = LazyLock::new(|| Table::Drivers {
drivers: vec![
DRIVER_FANGIO.clone(),
DRIVER_HAILWOOD.clone(),
DRIVER_ABATE.clone(),
DRIVER_MICHAEL.clone(),
DRIVER_JOS.clone(),
DRIVER_RALF.clone(),
DRIVER_WILSON.clone(),
DRIVER_KIMI.clone(),
DRIVER_ALONSO.clone(),
DRIVER_HAMILTON.clone(),
DRIVER_PEREZ.clone(),
DRIVER_SAINZ.clone(),
DRIVER_DE_VRIES.clone(),
DRIVER_MAX.clone(),
DRIVER_LECLERC.clone(),
DRIVER_RUSSELL.clone(),
],
});
pub(crate) const CONSTRUCTOR_ALFA_ROMEO_STR: &str = r#"{
"constructorId": "alfa",
"url": "http://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One",
"name": "Alfa Romeo",
"nationality": "Swiss"
}"#;
pub(crate) const CONSTRUCTOR_LOLA_STR: &str = r#"{
"constructorId": "lola",
"url": "http://en.wikipedia.org/wiki/MasterCard_Lola",
"name": "Lola",
"nationality": "British"
}"#;
pub(crate) const CONSTRUCTOR_MCLAREN_STR: &str = r#"{
"constructorId": "mclaren",
"url": "http://en.wikipedia.org/wiki/McLaren",
"name": "McLaren",
"nationality": "British"
}"#;
pub(crate) const CONSTRUCTOR_FERRARI_STR: &str = r#"{
"constructorId": "ferrari",
"url": "http://en.wikipedia.org/wiki/Scuderia_Ferrari",
"name": "Ferrari",
"nationality": "Italian"
}"#;
pub(crate) const CONSTRUCTOR_WILLIAMS_STR: &str = r#"{
"constructorId": "williams",
"url": "http://en.wikipedia.org/wiki/Williams_Grand_Prix_Engineering",
"name": "Williams",
"nationality": "British"
}"#;
pub(crate) const CONSTRUCTOR_MINARDI_STR: &str = r#"{
"constructorId": "minardi",
"url": "http://en.wikipedia.org/wiki/Minardi",
"name": "Minardi",
"nationality": "Italian"
}"#;
pub(crate) const CONSTRUCTOR_ALPHA_TAURI_STR: &str = r#"{
"constructorId": "alphatauri",
"url": "http://en.wikipedia.org/wiki/Scuderia_AlphaTauri",
"name": "AlphaTauri",
"nationality": "Italian"
}"#;
pub(crate) const CONSTRUCTOR_RED_BULL_STR: &str = r#"{
"constructorId": "red_bull",
"url": "http://en.wikipedia.org/wiki/Red_Bull_Racing",
"name": "Red Bull",
"nationality": "Austrian"
}"#;
pub(crate) const CONSTRUCTOR_MERCEDES_STR: &str = r#"{
"constructorId": "mercedes",
"url": "http://en.wikipedia.org/wiki/Mercedes-Benz_in_Formula_One",
"name": "Mercedes",
"nationality": "German"
}"#;
pub(crate) const CONSTRUCTOR_ASTON_MARTIN_STR: &str = r#"{
"constructorId": "aston_martin",
"url": "http://en.wikipedia.org/wiki/Aston_Martin_in_Formula_One",
"name": "Aston Martin",
"nationality": "British"
}"#;
pub(crate) static CONSTRUCTOR_ALFA_ROMEO: LazyLock<Constructor> = LazyLock::new(|| Constructor {
constructor_id: "alfa".into(),
url: Url::parse("http://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One").unwrap(),
name: "Alfa Romeo".to_string(),
nationality: "Swiss".to_string(),
});
pub(crate) static CONSTRUCTOR_LOLA: LazyLock<Constructor> = LazyLock::new(|| Constructor {
constructor_id: "lola".into(),
url: Url::parse("http://en.wikipedia.org/wiki/MasterCard_Lola").unwrap(),
name: "Lola".to_string(),
nationality: "British".to_string(),
});
pub(crate) static CONSTRUCTOR_MCLAREN: LazyLock<Constructor> = LazyLock::new(|| Constructor {
constructor_id: "mclaren".into(),
url: Url::parse("http://en.wikipedia.org/wiki/McLaren").unwrap(),
name: "McLaren".to_string(),
nationality: "British".to_string(),
});
pub(crate) static CONSTRUCTOR_FERRARI: LazyLock<Constructor> = LazyLock::new(|| Constructor {
constructor_id: "ferrari".into(),
url: Url::parse("http://en.wikipedia.org/wiki/Scuderia_Ferrari").unwrap(),
name: "Ferrari".to_string(),
nationality: "Italian".to_string(),
});
pub(crate) static CONSTRUCTOR_WILLIAMS: LazyLock<Constructor> = LazyLock::new(|| Constructor {
constructor_id: "williams".into(),
url: Url::parse("http://en.wikipedia.org/wiki/Williams_Grand_Prix_Engineering").unwrap(),
name: "Williams".to_string(),
nationality: "British".to_string(),
});
pub(crate) static CONSTRUCTOR_MINARDI: LazyLock<Constructor> = LazyLock::new(|| Constructor {
constructor_id: "minardi".into(),
url: Url::parse("http://en.wikipedia.org/wiki/Minardi").unwrap(),
name: "Minardi".to_string(),
nationality: "Italian".to_string(),
});
pub(crate) static CONSTRUCTOR_ALPHA_TAURI: LazyLock<Constructor> = LazyLock::new(|| Constructor {
constructor_id: "alphatauri".into(),
url: Url::parse("http://en.wikipedia.org/wiki/Scuderia_AlphaTauri").unwrap(),
name: "AlphaTauri".to_string(),
nationality: "Italian".to_string(),
});
pub(crate) static CONSTRUCTOR_RED_BULL: LazyLock<Constructor> = LazyLock::new(|| Constructor {
constructor_id: "red_bull".into(),
url: Url::parse("http://en.wikipedia.org/wiki/Red_Bull_Racing").unwrap(),
name: "Red Bull".to_string(),
nationality: "Austrian".to_string(),
});
pub(crate) static CONSTRUCTOR_MERCEDES: LazyLock<Constructor> = LazyLock::new(|| Constructor {
constructor_id: "mercedes".into(),
url: Url::parse("http://en.wikipedia.org/wiki/Mercedes-Benz_in_Formula_One").unwrap(),
name: "Mercedes".to_string(),
nationality: "German".to_string(),
});
pub(crate) static CONSTRUCTOR_ASTON_MARTIN: LazyLock<Constructor> = LazyLock::new(|| Constructor {
constructor_id: "aston_martin".into(),
url: Url::parse("http://en.wikipedia.org/wiki/Aston_Martin_in_Formula_One").unwrap(),
name: "Aston Martin".to_string(),
nationality: "British".to_string(),
});
pub(crate) const CONSTRUCTOR_TABLE_STR: &str = formatcp!(
r#"{{
"ConstructorTable": {{
"Constructors": [
{CONSTRUCTOR_ALFA_ROMEO_STR},
{CONSTRUCTOR_LOLA_STR},
{CONSTRUCTOR_MCLAREN_STR},
{CONSTRUCTOR_FERRARI_STR},
{CONSTRUCTOR_WILLIAMS_STR},
{CONSTRUCTOR_MINARDI_STR},
{CONSTRUCTOR_ALPHA_TAURI_STR},
{CONSTRUCTOR_RED_BULL_STR},
{CONSTRUCTOR_MERCEDES_STR},
{CONSTRUCTOR_ASTON_MARTIN_STR}
]
}}}}"#
);
pub(crate) static CONSTRUCTOR_TABLE: LazyLock<Table> = LazyLock::new(|| Table::Constructors {
constructors: vec![
CONSTRUCTOR_ALFA_ROMEO.clone(),
CONSTRUCTOR_LOLA.clone(),
CONSTRUCTOR_MCLAREN.clone(),
CONSTRUCTOR_FERRARI.clone(),
CONSTRUCTOR_WILLIAMS.clone(),
CONSTRUCTOR_MINARDI.clone(),
CONSTRUCTOR_ALPHA_TAURI.clone(),
CONSTRUCTOR_RED_BULL.clone(),
CONSTRUCTOR_MERCEDES.clone(),
CONSTRUCTOR_ASTON_MARTIN.clone(),
],
});
pub(crate) const CIRCUIT_GEORGE_STR: &str = r#"{
"circuitId": "george",
"url": "https://en.wikipedia.org/wiki/Prince_George_Circuit",
"circuitName": "Prince George Circuit",
"Location": {
"lat": "-33.0486",
"long": "27.8736",
"locality": "Eastern Cape Province",
"country": "South Africa"
}
}"#;
pub(crate) const CIRCUIT_MAGNY_COURS_STR: &str = r#"{
"circuitId": "magny_cours",
"url": "https://en.wikipedia.org/wiki/Circuit_de_Nevers_Magny-Cours",
"circuitName": "Circuit de Nevers Magny-Cours",
"Location": {
"lat": "46.8642",
"long": "3.16361",
"locality": "Magny Cours",
"country": "France"
}
}"#;
pub(crate) const CIRCUIT_SPA_STR: &str = r#"{
"circuitId": "spa",
"url": "https://en.wikipedia.org/wiki/Circuit_de_Spa-Francorchamps",
"circuitName": "Circuit de Spa-Francorchamps",
"Location": {
"lat": "50.4372",
"long": "5.97139",
"locality": "Spa",
"country": "Belgium"
}
}"#;
pub(crate) const CIRCUIT_ALBERT_PARK_STR: &str = r#"{
"circuitId": "albert_park",
"url": "https://en.wikipedia.org/wiki/Albert_Park_Circuit",
"circuitName": "Albert Park Grand Prix Circuit",
"Location": {
"lat": "-37.8497",
"long": "144.968",
"locality": "Melbourne",
"country": "Australia"
}
}"#;
pub(crate) const CIRCUIT_SILVERSTONE_STR: &str = r#"{
"circuitId": "silverstone",
"url": "https://en.wikipedia.org/wiki/Silverstone_Circuit",
"circuitName": "Silverstone Circuit",
"Location": {
"lat": "52.0786",
"long": "-1.01694",
"locality": "Silverstone",
"country": "UK"
}
}"#;
pub(crate) const CIRCUIT_IMOLA_STR: &str = r#"{
"circuitId": "imola",
"url": "https://en.wikipedia.org/wiki/Imola_Circuit",
"circuitName": "Autodromo Enzo e Dino Ferrari",
"Location": {
"lat": "44.3439",
"long": "11.7167",
"locality": "Imola",
"country": "Italy"
}
}"#;
pub(crate) const CIRCUIT_MUGELLO_STR: &str = r#"{
"circuitId": "mugello",
"url": "https://en.wikipedia.org/wiki/Mugello_Circuit",
"circuitName": "Autodromo Internazionale del Mugello",
"Location": {
"lat": "43.9975",
"long": "11.3719",
"locality": "Mugello",
"country": "Italy"
}
}"#;
pub(crate) const CIRCUIT_BAKU_STR: &str = r#"{
"circuitId": "baku",
"url": "https://en.wikipedia.org/wiki/Baku_City_Circuit",
"circuitName": "Baku City Circuit",
"Location": {
"lat": "40.3725",
"long": "49.8533",
"locality": "Baku",
"country": "Azerbaijan"
}
}"#;
pub(crate) const CIRCUIT_SHANGHAI_STR: &str = r#"{
"circuitId": "shanghai",
"url": "https://en.wikipedia.org/wiki/Shanghai_International_Circuit",
"circuitName": "Shanghai International Circuit",
"Location": {
"lat": "31.3389",
"long": "121.22",
"locality": "Shanghai",
"country": "China"
}
}"#;
pub(crate) static CIRCUIT_GEORGE: LazyLock<Circuit> = LazyLock::new(|| Circuit {
circuit_id: "george".into(),
url: Url::parse("https://en.wikipedia.org/wiki/Prince_George_Circuit").unwrap(),
circuit_name: "Prince George Circuit".to_string(),
location: Location {
lat: OrderedFloat(-33.0486),
long: OrderedFloat(27.8736),
locality: "Eastern Cape Province".to_string(),
country: "South Africa".to_string(),
},
});
pub(crate) static CIRCUIT_MAGNY_COURS: LazyLock<Circuit> = LazyLock::new(|| Circuit {
circuit_id: "magny_cours".into(),
url: Url::parse("https://en.wikipedia.org/wiki/Circuit_de_Nevers_Magny-Cours").unwrap(),
circuit_name: "Circuit de Nevers Magny-Cours".to_string(),
location: Location {
lat: OrderedFloat(46.8642),
long: OrderedFloat(3.16361),
locality: "Magny Cours".to_string(),
country: "France".to_string(),
},
});
pub(crate) static CIRCUIT_ALBERT_PARK: LazyLock<Circuit> = LazyLock::new(|| Circuit {
circuit_id: "albert_park".into(),
url: Url::parse("https://en.wikipedia.org/wiki/Albert_Park_Circuit").unwrap(),
circuit_name: "Albert Park Grand Prix Circuit".to_string(),
location: Location {
lat: OrderedFloat(-37.8497),
long: OrderedFloat(144.968),
locality: "Melbourne".to_string(),
country: "Australia".to_string(),
},
});
pub(crate) static CIRCUIT_SPA: LazyLock<Circuit> = LazyLock::new(|| Circuit {
circuit_id: "spa".into(),
url: Url::parse("https://en.wikipedia.org/wiki/Circuit_de_Spa-Francorchamps").unwrap(),
circuit_name: "Circuit de Spa-Francorchamps".to_string(),
location: Location {
lat: OrderedFloat(50.4372),
long: OrderedFloat(5.97139),
locality: "Spa".to_string(),
country: "Belgium".to_string(),
},
});
pub(crate) static CIRCUIT_SILVERSTONE: LazyLock<Circuit> = LazyLock::new(|| Circuit {
circuit_id: "silverstone".into(),
url: Url::parse("https://en.wikipedia.org/wiki/Silverstone_Circuit").unwrap(),
circuit_name: "Silverstone Circuit".to_string(),
location: Location {
lat: OrderedFloat(52.0786),
long: OrderedFloat(-1.01694),
locality: "Silverstone".to_string(),
country: "UK".to_string(),
},
});
pub(crate) static CIRCUIT_IMOLA: LazyLock<Circuit> = LazyLock::new(|| Circuit {
circuit_id: "imola".into(),
url: Url::parse("https://en.wikipedia.org/wiki/Imola_Circuit").unwrap(),
circuit_name: "Autodromo Enzo e Dino Ferrari".to_string(),
location: Location {
lat: OrderedFloat(44.3439),
long: OrderedFloat(11.7167),
locality: "Imola".to_string(),
country: "Italy".to_string(),
},
});
pub(crate) static CIRCUIT_MUGELLO: LazyLock<Circuit> = LazyLock::new(|| Circuit {
circuit_id: "mugello".into(),
url: Url::parse("https://en.wikipedia.org/wiki/Mugello_Circuit").unwrap(),
circuit_name: "Autodromo Internazionale del Mugello".to_string(),
location: Location {
lat: OrderedFloat(43.9975),
long: OrderedFloat(11.3719),
locality: "Mugello".to_string(),
country: "Italy".to_string(),
},
});
pub(crate) static CIRCUIT_BAKU: LazyLock<Circuit> = LazyLock::new(|| Circuit {
circuit_id: "baku".into(),
url: Url::parse("https://en.wikipedia.org/wiki/Baku_City_Circuit").unwrap(),
circuit_name: "Baku City Circuit".to_string(),
location: Location {
lat: OrderedFloat(40.3725),
long: OrderedFloat(49.8533),
locality: "Baku".to_string(),
country: "Azerbaijan".to_string(),
},
});
pub(crate) static CIRCUIT_SHANGHAI: LazyLock<Circuit> = LazyLock::new(|| Circuit {
circuit_id: "shanghai".into(),
url: Url::parse("https://en.wikipedia.org/wiki/Shanghai_International_Circuit").unwrap(),
circuit_name: "Shanghai International Circuit".to_string(),
location: Location {
lat: OrderedFloat(31.3389),
long: OrderedFloat(121.22),
locality: "Shanghai".to_string(),
country: "China".to_string(),
},
});
pub(crate) const CIRCUIT_TABLE_STR: &str = formatcp!(
r#"{{
"CircuitTable": {{
"Circuits": [
{CIRCUIT_GEORGE_STR},
{CIRCUIT_MAGNY_COURS_STR},
{CIRCUIT_ALBERT_PARK_STR},
{CIRCUIT_SPA_STR},
{CIRCUIT_SILVERSTONE_STR},
{CIRCUIT_IMOLA_STR},
{CIRCUIT_MUGELLO_STR},
{CIRCUIT_BAKU_STR},
{CIRCUIT_SHANGHAI_STR}
]
}}}}"#
);
pub(crate) static CIRCUIT_TABLE: LazyLock<Table> = LazyLock::new(|| Table::Circuits {
circuits: vec![
CIRCUIT_GEORGE.clone(),
CIRCUIT_MAGNY_COURS.clone(),
CIRCUIT_ALBERT_PARK.clone(),
CIRCUIT_SPA.clone(),
CIRCUIT_SILVERSTONE.clone(),
CIRCUIT_IMOLA.clone(),
CIRCUIT_MUGELLO.clone(),
CIRCUIT_BAKU.clone(),
CIRCUIT_SHANGHAI.clone(),
],
});
pub(crate) const RACE_1950_1_STR: &str = formatcp!(
r#"
"season": "1950",
"round": "1",
"url": "https://en.wikipedia.org/wiki/1950_British_Grand_Prix",
"raceName": "British Grand Prix",
"Circuit": {CIRCUIT_SILVERSTONE_STR},
"date": "1950-05-13"
"#
);
pub(crate) const RACE_1950_5_STR: &str = formatcp!(
r#"
"season": "1950",
"round": "5",
"url": "https://en.wikipedia.org/wiki/1950_Belgian_Grand_Prix",
"raceName": "Belgian Grand Prix",
"Circuit": {CIRCUIT_SPA_STR},
"date": "1950-06-18"
"#
);
pub(crate) const RACE_1963_10_STR: &str = formatcp!(
r#"
"season": "1963",
"round": "10",
"url": "https://en.wikipedia.org/wiki/1963_South_African_Grand_Prix",
"raceName": "South African Grand Prix",
"Circuit": {CIRCUIT_GEORGE_STR},
"date": "1963-12-28"
"#
);
pub(crate) const RACE_1998_8_STR: &str = formatcp!(
r#"
"season": "1998",
"round": "8",
"url": "https://en.wikipedia.org/wiki/1998_French_Grand_Prix",
"raceName": "French Grand Prix",
"Circuit": {CIRCUIT_MAGNY_COURS_STR},
"date": "1998-06-28"
"#
);
pub(crate) const RACE_2003_4_STR: &str = formatcp!(
r#"
"season": "2003",
"round": "4",
"url": "https://en.wikipedia.org/wiki/2003_San_Marino_Grand_Prix",
"raceName": "San Marino Grand Prix",
"Circuit": {CIRCUIT_IMOLA_STR},
"date": "2003-04-20"
"#
);
pub(crate) const RACE_2015_11_STR: &str = formatcp!(
r#"
"season": "2015",
"round": "11",
"url": "https://en.wikipedia.org/wiki/2015_Belgian_Grand_Prix",
"raceName": "Belgian Grand Prix",
"Circuit": {CIRCUIT_SPA_STR},
"date": "2015-08-23",
"time": "12:00:00Z"
"#
);
pub(crate) const RACE_2020_4_STR: &str = formatcp!(
r#"
"season": "2020",
"round": "4",
"url": "https://en.wikipedia.org/wiki/2020_British_Grand_Prix",
"raceName": "British Grand Prix",
"Circuit": {CIRCUIT_SILVERSTONE_STR},
"date": "2020-08-02",
"time": "13:10:00Z"
"#
);
pub(crate) const RACE_2020_9_STR: &str = formatcp!(
r#"
"season": "2020",
"round": "9",
"url": "https://en.wikipedia.org/wiki/2020_Tuscan_Grand_Prix",
"raceName": "Tuscan Grand Prix",
"Circuit": {CIRCUIT_MUGELLO_STR},
"date": "2020-09-13",
"time": "13:10:00Z"
"#
);
pub(crate) const RACE_2021_12_STR: &str = formatcp!(
r#"
"season": "2021",
"round": "12",
"url": "https://en.wikipedia.org/wiki/2021_Belgian_Grand_Prix",
"raceName": "Belgian Grand Prix",
"Circuit": {CIRCUIT_SPA_STR},
"date": "2021-08-29",
"time": "13:00:00Z"
"#
);
pub(crate) const RACE_2022_4_STR: &str = formatcp!(
r#"
"season": "2022",
"round": "4",
"url": "https://en.wikipedia.org/wiki/2022_Emilia_Romagna_Grand_Prix",
"raceName": "Emilia Romagna Grand Prix",
"Circuit": {CIRCUIT_IMOLA_STR},
"date": "2022-04-24",
"time": "13:00:00Z"
"#
);
pub(crate) const RACE_2023_3_STR: &str = formatcp!(
r#"
"season": "2023",
"round": "3",
"url": "https://en.wikipedia.org/wiki/2023_Australian_Grand_Prix",
"raceName": "Australian Grand Prix",
"Circuit": {CIRCUIT_ALBERT_PARK_STR},
"date": "2023-04-02",
"time": "05:00:00Z"
"#
);
pub(crate) const RACE_2023_4_STR: &str = formatcp!(
r#"
"season": "2023",
"round": "4",
"url": "https://en.wikipedia.org/wiki/2023_Azerbaijan_Grand_Prix",
"raceName": "Azerbaijan Grand Prix",
"Circuit": {CIRCUIT_BAKU_STR},
"date": "2023-04-30",
"time": "11:00:00Z"
"#
);
pub(crate) const RACE_2023_10_STR: &str = formatcp!(
r#"
"season": "2023",
"round": "10",
"url": "https://en.wikipedia.org/wiki/2023_British_Grand_Prix",
"raceName": "British Grand Prix",
"Circuit": {CIRCUIT_SILVERSTONE_STR},
"date": "2023-07-09",
"time": "14:00:00Z"
"#
);
pub(crate) const RACE_2023_12_STR: &str = formatcp!(
r#"
"season": "2023",
"round": "12",
"url": "https://en.wikipedia.org/wiki/2023_Belgian_Grand_Prix",
"raceName": "Belgian Grand Prix",
"Circuit": {CIRCUIT_SPA_STR},
"date": "2023-07-30",
"time": "13:00:00Z"
"#
);
pub(crate) const RACE_2024_5_STR: &str = formatcp!(
r#"
"season": "2024",
"round": "5",
"url": "https://en.wikipedia.org/wiki/2024_Chinese_Grand_Prix",
"raceName": "Chinese Grand Prix",
"Circuit": {CIRCUIT_SHANGHAI_STR},
"date": "2024-04-21",
"time": "07:00:00Z"
"#
);
pub(crate) const SCHEDULE_NONE: LazyLock<Schedule> = LazyLock::new(|| Schedule {
first_practice: None,
second_practice: None,
third_practice: None,
qualifying: None,
sprint: None,
sprint_shootout: None,
sprint_qualifying: None,
});
pub(crate) const RACE_NONE: LazyLock<Race> = LazyLock::new(|| Race {
season: 0,
round: 0,
url: Url::parse("https://empty.org").unwrap(),
race_name: "".to_string(),
circuit: Circuit {
circuit_id: "".to_string(),
url: Url::parse("https://empty.org").unwrap(),
circuit_name: "".to_string(),
location: Location {
lat: OrderedFloat(f64::NAN),
long: OrderedFloat(f64::NAN),
locality: "".to_string(),
country: "".to_string(),
},
},
date: Date::MIN,
time: None,
payload: Payload::Schedule(SCHEDULE_NONE.clone()),
});
pub(crate) const RACE_1950_1: LazyLock<Race> = LazyLock::new(|| Race {
season: 1950,
round: 1,
url: Url::parse("https://en.wikipedia.org/wiki/1950_British_Grand_Prix").unwrap(),
race_name: "British Grand Prix".to_string(),
circuit: CIRCUIT_SILVERSTONE.clone(),
date: date!(1950 - 05 - 13),
..RACE_NONE.clone()
});
pub(crate) const RACE_1950_5: LazyLock<Race> = LazyLock::new(|| Race {
season: 1950,
round: 5,
url: Url::parse("https://en.wikipedia.org/wiki/1950_Belgian_Grand_Prix").unwrap(),
race_name: "Belgian Grand Prix".to_string(),
circuit: CIRCUIT_SPA.clone(),
date: date!(1950 - 06 - 18),
..RACE_NONE.clone()
});
pub(crate) const RACE_1963_10: LazyLock<Race> = LazyLock::new(|| Race {
season: 1963,
round: 10,
url: Url::parse("https://en.wikipedia.org/wiki/1963_South_African_Grand_Prix").unwrap(),
race_name: "South African Grand Prix".to_string(),
circuit: CIRCUIT_GEORGE.clone(),
date: date!(1963 - 12 - 28),
..RACE_NONE.clone()
});
pub(crate) const RACE_1998_8: LazyLock<Race> = LazyLock::new(|| Race {
season: 1998,
round: 8,
url: Url::parse("https://en.wikipedia.org/wiki/1998_French_Grand_Prix").unwrap(),
race_name: "French Grand Prix".to_string(),
circuit: CIRCUIT_MAGNY_COURS.clone(),
date: date!(1998 - 06 - 28),
..RACE_NONE.clone()
});
pub(crate) const RACE_2003_4: LazyLock<Race> = LazyLock::new(|| Race {
season: 2003,
round: 4,
url: Url::parse("https://en.wikipedia.org/wiki/2003_San_Marino_Grand_Prix").unwrap(),
race_name: "San Marino Grand Prix".to_string(),
circuit: CIRCUIT_IMOLA.clone(),
date: date!(2003 - 04 - 20),
..RACE_NONE.clone()
});
pub(crate) const RACE_2015_11: LazyLock<Race> = LazyLock::new(|| Race {
season: 2015,
round: 11,
url: Url::parse("https://en.wikipedia.org/wiki/2015_Belgian_Grand_Prix").unwrap(),
race_name: "Belgian Grand Prix".to_string(),
circuit: CIRCUIT_SPA.clone(),
date: date!(2015 - 08 - 23),
time: Some(time!(12:00:00)),
..RACE_NONE.clone()
});
pub(crate) const RACE_2020_4: LazyLock<Race> = LazyLock::new(|| Race {
season: 2020,
round: 4,
url: Url::parse("https://en.wikipedia.org/wiki/2020_British_Grand_Prix").unwrap(),
race_name: "British Grand Prix".to_string(),
circuit: CIRCUIT_SILVERSTONE.clone(),
date: date!(2020 - 08 - 02),
time: Some(time!(13:10:00)),
..RACE_NONE.clone()
});
pub(crate) const RACE_2020_9: LazyLock<Race> = LazyLock::new(|| Race {
season: 2020,
round: 9,
url: Url::parse("https://en.wikipedia.org/wiki/2020_Tuscan_Grand_Prix").unwrap(),
race_name: "Tuscan Grand Prix".to_string(),
circuit: CIRCUIT_MUGELLO.clone(),
date: date!(2020 - 09 - 13),
time: Some(time!(13:10:00)),
..RACE_NONE.clone()
});
pub(crate) const RACE_2021_12: LazyLock<Race> = LazyLock::new(|| Race {
season: 2021,
round: 12,
url: Url::parse("https://en.wikipedia.org/wiki/2021_Belgian_Grand_Prix").unwrap(),
race_name: "Belgian Grand Prix".to_string(),
circuit: CIRCUIT_SPA.clone(),
date: date!(2021 - 08 - 29),
time: Some(time!(13:00:00)),
..RACE_NONE.clone()
});
pub(crate) const RACE_2022_4: LazyLock<Race> = LazyLock::new(|| Race {
season: 2022,
round: 4,
url: Url::parse("https://en.wikipedia.org/wiki/2022_Emilia_Romagna_Grand_Prix").unwrap(),
race_name: "Emilia Romagna Grand Prix".to_string(),
circuit: CIRCUIT_IMOLA.clone(),
date: date!(2022 - 04 - 24),
time: Some(time!(13:00:00)),
..RACE_NONE.clone()
});
pub(crate) const RACE_2023_3: LazyLock<Race> = LazyLock::new(|| Race {
season: 2023,
round: 3,
url: Url::parse("https://en.wikipedia.org/wiki/2023_Australian_Grand_Prix").unwrap(),
race_name: "Australian Grand Prix".to_string(),
circuit: CIRCUIT_ALBERT_PARK.clone(),
date: date!(2023 - 04 - 02),
time: Some(time!(5:00:00)),
..RACE_NONE.clone()
});
pub(crate) const RACE_2023_4: LazyLock<Race> = LazyLock::new(|| Race {
season: 2023,
round: 4,
url: Url::parse("https://en.wikipedia.org/wiki/2023_Azerbaijan_Grand_Prix").unwrap(),
race_name: "Azerbaijan Grand Prix".to_string(),
circuit: CIRCUIT_BAKU.clone(),
date: date!(2023 - 04 - 30),
time: Some(time!(11:00:00)),
..RACE_NONE.clone()
});
pub(crate) const RACE_2023_10: LazyLock<Race> = LazyLock::new(|| Race {
season: 2023,
round: 10,
url: Url::parse("https://en.wikipedia.org/wiki/2023_British_Grand_Prix").unwrap(),
race_name: "British Grand Prix".to_string(),
circuit: CIRCUIT_SILVERSTONE.clone(),
date: date!(2023 - 07 - 09),
time: Some(time!(14:00:00)),
..RACE_NONE.clone()
});
pub(crate) const RACE_2023_12: LazyLock<Race> = LazyLock::new(|| Race {
season: 2023,
round: 12,
url: Url::parse("https://en.wikipedia.org/wiki/2023_Belgian_Grand_Prix").unwrap(),
race_name: "Belgian Grand Prix".to_string(),
circuit: CIRCUIT_SPA.clone(),
date: date!(2023 - 07 - 30),
time: Some(time!(13:00:00)),
..RACE_NONE.clone()
});
pub(crate) const RACE_2024_5: LazyLock<Race> = LazyLock::new(|| Race {
season: 2024,
round: 5,
url: Url::parse("https://en.wikipedia.org/wiki/2024_Chinese_Grand_Prix").unwrap(),
race_name: "Chinese Grand Prix".to_string(),
circuit: CIRCUIT_SHANGHAI.clone(),
date: date!(2024 - 04 - 21),
time: Some(time!(07:00:00)),
..RACE_NONE.clone()
});
pub(crate) const RACE_1950_1_SCHEDULE_STR: &str = formatcp!(
r#"{{
{RACE_1950_1_STR}
}}"#
);
pub(crate) const RACE_1963_10_SCHEDULE_STR: &str = formatcp!(
r#"{{
{RACE_1963_10_STR}
}}"#
);
pub(crate) const RACE_2003_4_SCHEDULE_STR: &str = formatcp!(
r#"{{
{RACE_2003_4_STR}
}}"#
);
pub(crate) const RACE_2015_11_SCHEDULE_STR: &str = formatcp!(
r#"{{
{RACE_2015_11_STR},
"FirstPractice": {{
"date": "2015-08-21"
}},
"SecondPractice": {{
"date": "2015-08-21"
}},
"ThirdPractice": {{
"date": "2015-08-22"
}},
"Qualifying": {{
"date": "2015-08-22"
}}
}}"#
);
pub(crate) const RACE_2020_4_SCHEDULE_STR: &str = formatcp!(
r#"{{
{RACE_2020_4_STR},
"FirstPractice": {{
"date": "2020-07-31"
}},
"SecondPractice": {{
"date": "2020-07-31"
}},
"ThirdPractice": {{
"date": "2020-08-01"
}},
"Qualifying": {{
"date": "2020-08-01"
}}
}}"#
);
pub(crate) const RACE_2021_12_SCHEDULE_STR: &str = formatcp!(
r#"{{
{RACE_2021_12_STR},
"FirstPractice": {{
"date": "2021-08-27"
}},
"SecondPractice": {{
"date": "2021-08-27"
}},
"ThirdPractice": {{
"date": "2021-08-28"
}},
"Qualifying": {{
"date": "2021-08-28"
}}
}}"#
);
pub(crate) const RACE_2022_4_SCHEDULE_STR: &str = formatcp!(
r#"{{
{RACE_2022_4_STR},
"FirstPractice": {{
"date": "2022-04-22",
"time": "11:30:00Z"
}},
"Qualifying": {{
"date": "2022-04-22",
"time": "15:00:00Z"
}},
"SecondPractice": {{
"date": "2022-04-23",
"time": "10:30:00Z"
}},
"Sprint": {{
"date": "2022-04-23",
"time": "14:30:00Z"
}}
}}"#
);
pub(crate) const RACE_2023_3_SCHEDULE_STR: &str = formatcp!(
r#"{{
{RACE_2023_3_STR},
"FirstPractice": {{
"date": "2023-03-31",
"time": "01:30:00Z"
}},
"SecondPractice": {{
"date": "2023-03-31",
"time": "05:00:00Z"
}},
"ThirdPractice": {{
"date": "2023-04-01",
"time": "01:30:00Z"
}},
"Qualifying": {{
"date": "2023-04-01",
"time": "05:00:00Z"
}}
}}"#
);
pub(crate) const RACE_2023_4_SCHEDULE_STR: &str = formatcp!(
r#"{{
{RACE_2023_4_STR},
"FirstPractice": {{
"date": "2023-04-28",
"time": "09:30:00Z"
}},
"Qualifying": {{
"date": "2023-04-28",
"time": "13:00:00Z"
}},
"Sprint": {{
"date": "2023-04-29",
"time": "13:30:00Z"
}},
"SprintShootout": {{
"date": "2023-04-29",
"time": "09:30:00Z"
}}
}}"#
);
pub(crate) const RACE_2023_10_SCHEDULE_STR: &str = formatcp!(
r#"{{
{RACE_2023_10_STR},
"FirstPractice": {{
"date": "2023-07-07",
"time": "11:30:00Z"
}},
"SecondPractice": {{
"date": "2023-07-07",
"time": "15:00:00Z"
}},
"ThirdPractice": {{
"date": "2023-07-08",
"time": "10:30:00Z"
}},
"Qualifying": {{
"date": "2023-07-08",
"time": "14:00:00Z"
}}
}}"#
);
pub(crate) const RACE_2023_12_SCHEDULE_STR: &str = formatcp!(
r#"{{
{RACE_2023_12_STR},
"FirstPractice": {{
"date": "2023-07-28",
"time": "11:30:00Z"
}},
"Qualifying": {{
"date": "2023-07-28",
"time": "15:00:00Z"
}},
"Sprint": {{
"date": "2023-07-29",
"time": "14:30:00Z"
}},
"SprintShootout": {{
"date": "2023-07-29",
"time": "10:30:00Z"
}}
}}"#
);
pub(crate) const RACE_2024_5_SCHEDULE_STR: &str = formatcp!(
r#"{{
{RACE_2024_5_STR},
"FirstPractice": {{
"date": "2024-04-19",
"time": "03:30:00Z"
}},
"Qualifying": {{
"date": "2024-04-20",
"time": "07:00:00Z"
}},
"Sprint": {{
"date": "2024-04-20",
"time": "03:00:00Z"
}},
"SprintQualifying": {{
"date": "2024-04-19",
"time": "07:30:00Z"
}}
}}"#
);
pub(crate) const RACE_1950_1_SCHEDULE: LazyLock<Race> = LazyLock::new(|| Race { ..RACE_1950_1.clone() });
pub(crate) const RACE_1963_10_SCHEDULE: LazyLock<Race> = LazyLock::new(|| Race { ..RACE_1963_10.clone() });
pub(crate) const RACE_2003_4_SCHEDULE: LazyLock<Race> = LazyLock::new(|| Race { ..RACE_2003_4.clone() });
pub(crate) const RACE_2015_11_SCHEDULE: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::Schedule(Schedule {
first_practice: Some(DateTime {
date: date!(2015 - 08 - 21),
time: None,
}),
second_practice: Some(DateTime {
date: date!(2015 - 08 - 21),
time: None,
}),
third_practice: Some(DateTime {
date: date!(2015 - 08 - 22),
time: None,
}),
qualifying: Some(DateTime {
date: date!(2015 - 08 - 22),
time: None,
}),
sprint: None,
sprint_shootout: None,
sprint_qualifying: None,
}),
..RACE_2015_11.clone()
});
pub(crate) const RACE_2020_4_SCHEDULE: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::Schedule(Schedule {
first_practice: Some(DateTime {
date: date!(2020 - 07 - 31),
time: None,
}),
second_practice: Some(DateTime {
date: date!(2020 - 07 - 31),
time: None,
}),
third_practice: Some(DateTime {
date: date!(2020 - 08 - 01),
time: None,
}),
qualifying: Some(DateTime {
date: date!(2020 - 08 - 01),
time: None,
}),
sprint: None,
sprint_shootout: None,
sprint_qualifying: None,
}),
..RACE_2020_4.clone()
});
pub(crate) const RACE_2021_12_SCHEDULE: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::Schedule(Schedule {
first_practice: Some(DateTime {
date: date!(2021 - 08 - 27),
time: None,
}),
second_practice: Some(DateTime {
date: date!(2021 - 08 - 27),
time: None,
}),
third_practice: Some(DateTime {
date: date!(2021 - 08 - 28),
time: None,
}),
qualifying: Some(DateTime {
date: date!(2021 - 08 - 28),
time: None,
}),
..SCHEDULE_NONE.clone()
}),
..RACE_2021_12.clone()
});
pub(crate) const RACE_2022_4_SCHEDULE: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::Schedule(Schedule {
first_practice: Some(DateTime {
date: date!(2022 - 04 - 22),
time: Some(time!(11:30:00)),
}),
qualifying: Some(DateTime {
date: date!(2022 - 04 - 22),
time: Some(time!(15:00:00)),
}),
second_practice: Some(DateTime {
date: date!(2022 - 04 - 23),
time: Some(time!(10:30:00)),
}),
sprint: Some(DateTime {
date: date!(2022 - 04 - 23),
time: Some(time!(14:30:00)),
}),
..SCHEDULE_NONE.clone()
}),
..RACE_2022_4.clone()
});
pub(crate) const RACE_2023_3_SCHEDULE: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::Schedule(Schedule {
first_practice: Some(DateTime {
date: date!(2023 - 03 - 31),
time: Some(time!(01:30:00)),
}),
second_practice: Some(DateTime {
date: date!(2023 - 03 - 31),
time: Some(time!(05:00:00)),
}),
third_practice: Some(DateTime {
date: date!(2023 - 04 - 01),
time: Some(time!(01:30:00)),
}),
qualifying: Some(DateTime {
date: date!(2023 - 04 - 01),
time: Some(time!(05:00:00)),
}),
..SCHEDULE_NONE.clone()
}),
..RACE_2023_3.clone()
});
pub(crate) const RACE_2023_4_SCHEDULE: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::Schedule(Schedule {
first_practice: Some(DateTime {
date: date!(2023 - 04 - 28),
time: Some(time!(09:30:00)),
}),
qualifying: Some(DateTime {
date: date!(2023 - 04 - 28),
time: Some(time!(13:00:00)),
}),
sprint: Some(DateTime {
date: date!(2023 - 04 - 29),
time: Some(time!(13:30:00)),
}),
sprint_shootout: Some(DateTime {
date: date!(2023 - 04 - 29),
time: Some(time!(09:30:00)),
}),
..SCHEDULE_NONE.clone()
}),
..RACE_2023_4.clone()
});
pub(crate) const RACE_2023_10_SCHEDULE: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::Schedule(Schedule {
first_practice: Some(DateTime {
date: date!(2023 - 07 - 07),
time: Some(time!(11:30:00)),
}),
second_practice: Some(DateTime {
date: date!(2023 - 07 - 07),
time: Some(time!(15:00:00)),
}),
third_practice: Some(DateTime {
date: date!(2023 - 07 - 08),
time: Some(time!(10:30:00)),
}),
qualifying: Some(DateTime {
date: date!(2023 - 07 - 08),
time: Some(time!(14:00:00)),
}),
..SCHEDULE_NONE.clone()
}),
..RACE_2023_10.clone()
});
pub(crate) const RACE_2023_12_SCHEDULE: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::Schedule(Schedule {
first_practice: Some(DateTime {
date: date!(2023 - 07 - 28),
time: Some(time!(11:30:00)),
}),
qualifying: Some(DateTime {
date: date!(2023 - 07 - 28),
time: Some(time!(15:00:00)),
}),
sprint: Some(DateTime {
date: date!(2023 - 07 - 29),
time: Some(time!(14:30:00)),
}),
sprint_shootout: Some(DateTime {
date: date!(2023 - 07 - 29),
time: Some(time!(10:30:00)),
}),
..SCHEDULE_NONE.clone()
}),
..RACE_2023_12.clone()
});
pub(crate) const RACE_2024_5_SCHEDULE: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::Schedule(Schedule {
first_practice: Some(DateTime {
date: date!(2024 - 04 - 19),
time: Some(time!(03:30:00)),
}),
qualifying: Some(DateTime {
date: date!(2024 - 04 - 20),
time: Some(time!(07:00:00)),
}),
sprint: Some(DateTime {
date: date!(2024 - 04 - 20),
time: Some(time!(03:00:00)),
}),
sprint_qualifying: Some(DateTime {
date: date!(2024 - 04 - 19),
time: Some(time!(07:30:00)),
}),
..SCHEDULE_NONE.clone()
}),
..RACE_2024_5.clone()
});
pub(crate) const RACE_TABLE_SCHEDULE_STR: &str = formatcp!(
r#"{{
"RaceTable": {{
"Races": [
{RACE_1950_1_SCHEDULE_STR},
{RACE_1963_10_SCHEDULE_STR},
{RACE_2003_4_SCHEDULE_STR},
{RACE_2015_11_SCHEDULE_STR},
{RACE_2020_4_SCHEDULE_STR},
{RACE_2021_12_SCHEDULE_STR},
{RACE_2022_4_SCHEDULE_STR},
{RACE_2023_3_SCHEDULE_STR},
{RACE_2023_4_SCHEDULE_STR},
{RACE_2023_10_SCHEDULE_STR},
{RACE_2023_12_SCHEDULE_STR},
{RACE_2024_5_SCHEDULE_STR}
]
}}}}"#
);
pub(crate) static RACE_TABLE_SCHEDULE: LazyLock<Table> = LazyLock::new(|| Table::Races {
races: vec![
RACE_1950_1_SCHEDULE.clone(),
RACE_1963_10_SCHEDULE.clone(),
RACE_2003_4_SCHEDULE.clone(),
RACE_2015_11_SCHEDULE.clone(),
RACE_2020_4_SCHEDULE.clone(),
RACE_2021_12_SCHEDULE.clone(),
RACE_2022_4_SCHEDULE.clone(),
RACE_2023_3_SCHEDULE.clone(),
RACE_2023_4_SCHEDULE.clone(),
RACE_2023_10_SCHEDULE.clone(),
RACE_2023_12_SCHEDULE.clone(),
RACE_2024_5_SCHEDULE.clone(),
],
});
pub(crate) const QUALIFYING_RESULT_2003_4_P1_STR: &str = formatcp!(
r#"{{
"number": "1",
"position": "1",
"Driver": {DRIVER_MICHAEL_STR},
"Constructor": {CONSTRUCTOR_FERRARI_STR},
"Q1": "1:22.327"
}}"#
);
pub(crate) const QUALIFYING_RESULT_2003_4_P2_STR: &str = formatcp!(
r#"{{
"number": "4",
"position": "2",
"Driver": {DRIVER_RALF_STR},
"Constructor": {CONSTRUCTOR_WILLIAMS_STR},
"Q1": "1:22.341"
}}"#
);
pub(crate) const QUALIFYING_RESULT_2003_4_P20_STR: &str = formatcp!(
r#"{{
"number": "19",
"position": "20",
"Driver": {DRIVER_JOS_STR},
"Constructor": {CONSTRUCTOR_MINARDI_STR},
"Q1": ""
}}"#
);
pub(crate) const QUALIFYING_RESULT_2023_4_P1_STR: &str = formatcp!(
r#"{{
"number": "16",
"position": "1",
"Driver": {DRIVER_LECLERC_STR},
"Constructor": {CONSTRUCTOR_FERRARI_STR},
"Q1": "1:41.269",
"Q2": "1:41.037",
"Q3": "1:40.203"
}}"#
);
pub(crate) const QUALIFYING_RESULT_2023_4_P2_STR: &str = formatcp!(
r#"{{
"number": "1",
"position": "2",
"Driver": {DRIVER_MAX_STR},
"Constructor": {CONSTRUCTOR_RED_BULL_STR},
"Q1": "1:41.398",
"Q2": "1:40.822",
"Q3": "1:40.391"
}}"#
);
pub(crate) const QUALIFYING_RESULT_2023_4_P3_STR: &str = formatcp!(
r#"{{
"number": "11",
"position": "3",
"Driver": {DRIVER_PEREZ_STR},
"Constructor": {CONSTRUCTOR_RED_BULL_STR},
"Q1": "1:41.131",
"Q2": "1:41.131",
"Q3": "1:40.495"
}}"#
);
pub(crate) const QUALIFYING_RESULT_2023_10_P4_STR: &str = formatcp!(
r#"{{
"number": "16",
"position": "4",
"Driver": {DRIVER_LECLERC_STR},
"Constructor": {CONSTRUCTOR_FERRARI_STR},
"Q1": "1:29.143",
"Q2": "1:28.361",
"Q3": "1:27.136"
}}"#
);
pub(crate) const QUALIFYING_RESULT_2023_12_P2_STR: &str = formatcp!(
r#"{{
"number": "16",
"position": "2",
"Driver": {DRIVER_LECLERC_STR},
"Constructor": {CONSTRUCTOR_FERRARI_STR},
"Q1": "1:58.300",
"Q2": "1:52.017",
"Q3": "1:46.988"
}}"#
);
pub(crate) const QUALIFYING_RESULT_2003_4_P1: LazyLock<QualifyingResult> = LazyLock::new(|| QualifyingResult {
number: 1,
position: 1,
driver: DRIVER_MICHAEL.clone(),
constructor: CONSTRUCTOR_FERRARI.clone(),
q1: Some(QualifyingTime::Time(duration_m_s_ms(1, 22, 327))),
q2: None,
q3: None,
});
pub(crate) const QUALIFYING_RESULT_2003_4_P2: LazyLock<QualifyingResult> = LazyLock::new(|| QualifyingResult {
number: 4,
position: 2,
driver: DRIVER_RALF.clone(),
constructor: CONSTRUCTOR_WILLIAMS.clone(),
q1: Some(QualifyingTime::Time(duration_m_s_ms(1, 22, 341))),
q2: None,
q3: None,
});
pub(crate) const QUALIFYING_RESULT_2003_4_P20: LazyLock<QualifyingResult> = LazyLock::new(|| QualifyingResult {
number: 19,
position: 20,
driver: DRIVER_JOS.clone(),
constructor: CONSTRUCTOR_MINARDI.clone(),
q1: Some(QualifyingTime::NoTimeSet),
q2: None,
q3: None,
});
pub(crate) const QUALIFYING_RESULT_2023_4_P1: LazyLock<QualifyingResult> = LazyLock::new(|| QualifyingResult {
number: 16,
position: 1,
driver: DRIVER_LECLERC.clone(),
constructor: CONSTRUCTOR_FERRARI.clone(),
q1: Some(QualifyingTime::Time(duration_m_s_ms(1, 41, 269))),
q2: Some(QualifyingTime::Time(duration_m_s_ms(1, 41, 037))),
q3: Some(QualifyingTime::Time(duration_m_s_ms(1, 40, 203))),
});
pub(crate) const QUALIFYING_RESULT_2023_4_P2: LazyLock<QualifyingResult> = LazyLock::new(|| QualifyingResult {
number: 1,
position: 2,
driver: DRIVER_MAX.clone(),
constructor: CONSTRUCTOR_RED_BULL.clone(),
q1: Some(QualifyingTime::Time(duration_m_s_ms(1, 41, 398))),
q2: Some(QualifyingTime::Time(duration_m_s_ms(1, 40, 822))),
q3: Some(QualifyingTime::Time(duration_m_s_ms(1, 40, 391))),
});
pub(crate) const QUALIFYING_RESULT_2023_4_P3: LazyLock<QualifyingResult> = LazyLock::new(|| QualifyingResult {
number: 11,
position: 3,
driver: DRIVER_PEREZ.clone(),
constructor: CONSTRUCTOR_RED_BULL.clone(),
q1: Some(QualifyingTime::Time(duration_m_s_ms(1, 41, 131))),
q2: Some(QualifyingTime::Time(duration_m_s_ms(1, 41, 131))),
q3: Some(QualifyingTime::Time(duration_m_s_ms(1, 40, 495))),
});
pub(crate) const QUALIFYING_RESULT_2023_10_P4: LazyLock<QualifyingResult> = LazyLock::new(|| QualifyingResult {
number: 16,
position: 4,
driver: DRIVER_LECLERC.clone(),
constructor: CONSTRUCTOR_FERRARI.clone(),
q1: Some(QualifyingTime::Time(duration_m_s_ms(1, 29, 143))),
q2: Some(QualifyingTime::Time(duration_m_s_ms(1, 28, 361))),
q3: Some(QualifyingTime::Time(duration_m_s_ms(1, 27, 136))),
});
pub(crate) const QUALIFYING_RESULT_2023_12_P2: LazyLock<QualifyingResult> = LazyLock::new(|| QualifyingResult {
number: 16,
position: 2,
driver: DRIVER_LECLERC.clone(),
constructor: CONSTRUCTOR_FERRARI.clone(),
q1: Some(QualifyingTime::Time(duration_m_s_ms(1, 58, 300))),
q2: Some(QualifyingTime::Time(duration_m_s_ms(1, 52, 017))),
q3: Some(QualifyingTime::Time(duration_m_s_ms(1, 46, 988))),
});
pub(crate) const RACE_2003_4_QUALIFYING_RESULTS_STR: &str = formatcp!(
r#"{{
{RACE_2003_4_STR},
"QualifyingResults": [
{QUALIFYING_RESULT_2003_4_P1_STR},
{QUALIFYING_RESULT_2003_4_P2_STR},
{QUALIFYING_RESULT_2003_4_P20_STR}
]
}}"#
);
pub(crate) static RACE_2003_4_QUALIFYING_RESULTS: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::QualifyingResults(vec![
QUALIFYING_RESULT_2003_4_P1.clone(),
QUALIFYING_RESULT_2003_4_P2.clone(),
QUALIFYING_RESULT_2003_4_P20.clone(),
]),
..RACE_2003_4.clone()
});
pub(crate) const RACE_2023_4_QUALIFYING_RESULTS_STR: &str = formatcp!(
r#"{{
{RACE_2023_4_STR},
"QualifyingResults": [
{QUALIFYING_RESULT_2023_4_P1_STR},
{QUALIFYING_RESULT_2023_4_P2_STR},
{QUALIFYING_RESULT_2023_4_P3_STR}
]
}}"#
);
pub(crate) static RACE_2023_4_QUALIFYING_RESULTS: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::QualifyingResults(vec![
QUALIFYING_RESULT_2023_4_P1.clone(),
QUALIFYING_RESULT_2023_4_P2.clone(),
QUALIFYING_RESULT_2023_4_P3.clone(),
]),
..RACE_2023_4.clone()
});
pub(crate) const RACE_2023_10_QUALIFYING_RESULTS_STR: &str = formatcp!(
r#"{{
{RACE_2023_10_STR},
"QualifyingResults": [
{QUALIFYING_RESULT_2023_10_P4_STR}
]
}}"#
);
pub(crate) static RACE_2023_10_QUALIFYING_RESULTS: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::QualifyingResults(vec![QUALIFYING_RESULT_2023_10_P4.clone()]),
..RACE_2023_10.clone()
});
pub(crate) const RACE_2023_12_QUALIFYING_RESULTS_STR: &str = formatcp!(
r#"{{
{RACE_2023_12_STR},
"QualifyingResults": [
{QUALIFYING_RESULT_2023_12_P2_STR}
]
}}"#
);
pub(crate) static RACE_2023_12_QUALIFYING_RESULTS: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::QualifyingResults(vec![QUALIFYING_RESULT_2023_12_P2.clone()]),
..RACE_2023_12.clone()
});
pub(crate) const RACE_TIME_1950_4_P1_STR: &str = r#"{
"millis": "7373700",
"time": "2:02:53.7"
}"#;
pub(crate) const RACE_TIME_1950_4_P2_STR: &str = r#"{
"millis": "7374100",
"time": "+0.4"
}"#;
pub(crate) const RACE_TIME_2003_4_P1_STR: &str = r#"{
"millis": "5292058",
"time": "1:28:12.058"
}"#;
pub(crate) const RACE_TIME_2003_4_P2_STR: &str = r#"{
"millis": "5293940",
"time": "+1.882"
}"#;
pub(crate) const RACE_TIME_2003_4_P3_STR: &str = r#"{
"millis": "5294349",
"time": "+2.291"
}"#;
pub(crate) const RACE_TIME_2021_12_P1_STR: &str = r#"{
"millis": "207071",
"time": "3:27.071"
}"#;
pub(crate) const RACE_TIME_2021_12_P2_STR: &str = r#"{
"millis": "209066",
"time": "+1.995"
}"#;
pub(crate) const RACE_TIME_2021_12_P3_STR: &str = r#"{
"millis": "209672",
"time": "+2.601"
}"#;
pub(crate) const RACE_TIME_2021_12_P10_STR: &str = r#"{
"millis": "223237",
"time": "+16.166"
}"#;
pub(crate) const RACE_TIME_2023_4_P1_STR: &str = r#"{
"millis": "5562436",
"time": "1:32:42.436"
}"#;
pub(crate) const RACE_TIME_2023_4_P2_STR: &str = r#"{
"millis": "5564573",
"time": "+2.137"
}"#;
pub(crate) const RACE_TIME_2023_4_P3_STR: &str = r#"{
"millis": "5583653",
"time": "+21.217"
}"#;
pub(crate) const RACE_TIME_1950_4_P1: LazyLock<RaceTime> = LazyLock::new(|| RaceTime::lead(duration_millis(7373700)));
pub(crate) const RACE_TIME_1950_4_P2: LazyLock<RaceTime> =
LazyLock::new(|| RaceTime::with_delta(duration_millis(7374100), duration_millis(400)));
pub(crate) const RACE_TIME_1950_5_P1: LazyLock<RaceTime> = LazyLock::new(|| RaceTime::lead(duration_millis(10046000)));
pub(crate) const RACE_TIME_2003_4_P1: LazyLock<RaceTime> = LazyLock::new(|| RaceTime::lead(duration_millis(5292058)));
pub(crate) const RACE_TIME_2003_4_P2: LazyLock<RaceTime> =
LazyLock::new(|| RaceTime::with_delta(duration_millis(5293940), duration_s_ms(1, 882)));
pub(crate) const RACE_TIME_2003_4_P3: LazyLock<RaceTime> =
LazyLock::new(|| RaceTime::with_delta(duration_millis(5294349), duration_s_ms(2, 291)));
pub(crate) const RACE_TIME_2021_12_P1: LazyLock<RaceTime> = LazyLock::new(|| RaceTime::lead(duration_millis(207071)));
pub(crate) const RACE_TIME_2021_12_P2: LazyLock<RaceTime> =
LazyLock::new(|| RaceTime::with_delta(duration_millis(209066), duration_s_ms(1, 995)));
pub(crate) const RACE_TIME_2021_12_P3: LazyLock<RaceTime> =
LazyLock::new(|| RaceTime::with_delta(duration_millis(209672), duration_s_ms(2, 601)));
pub(crate) const RACE_TIME_2021_12_P10: LazyLock<RaceTime> =
LazyLock::new(|| RaceTime::with_delta(duration_millis(223237), duration_s_ms(16, 166)));
pub(crate) const RACE_TIME_2023_4_P1: LazyLock<RaceTime> = LazyLock::new(|| RaceTime::lead(duration_millis(5562436)));
pub(crate) const RACE_TIME_2023_4_P2: LazyLock<RaceTime> =
LazyLock::new(|| RaceTime::with_delta(duration_millis(5564573), duration_s_ms(2, 137)));
pub(crate) const RACE_TIME_2023_4_P3: LazyLock<RaceTime> =
LazyLock::new(|| RaceTime::with_delta(duration_millis(5583653), duration_s_ms(21, 217)));
pub(crate) static RACE_TIMES_1950_4_STR: LazyLock<Vec<&str>> =
LazyLock::new(|| vec![RACE_TIME_1950_4_P1_STR, RACE_TIME_1950_4_P2_STR]);
pub(crate) static RACE_TIMES_2003_4_STR: LazyLock<Vec<&str>> = LazyLock::new(|| {
vec![
RACE_TIME_2003_4_P1_STR,
RACE_TIME_2003_4_P2_STR,
RACE_TIME_2003_4_P3_STR,
]
});
pub(crate) static RACE_TIMES_2021_12_STR: LazyLock<Vec<&str>> = LazyLock::new(|| {
vec![
RACE_TIME_2021_12_P1_STR,
RACE_TIME_2021_12_P2_STR,
RACE_TIME_2021_12_P3_STR,
RACE_TIME_2021_12_P10_STR,
]
});
pub(crate) static RACE_TIMES_2023_4_STR: LazyLock<Vec<&str>> = LazyLock::new(|| {
vec![
RACE_TIME_2023_4_P1_STR,
RACE_TIME_2023_4_P2_STR,
RACE_TIME_2023_4_P3_STR,
]
});
pub(crate) static RACE_TIMES_1950_4: LazyLock<Vec<RaceTime>> =
LazyLock::new(|| vec![RACE_TIME_1950_4_P1.clone(), RACE_TIME_1950_4_P2.clone()]);
pub(crate) static RACE_TIMES_2003_4: LazyLock<Vec<RaceTime>> = LazyLock::new(|| {
vec![
RACE_TIME_2003_4_P1.clone(),
RACE_TIME_2003_4_P2.clone(),
RACE_TIME_2003_4_P3.clone(),
]
});
pub(crate) static RACE_TIMES_2021_12: LazyLock<Vec<RaceTime>> = LazyLock::new(|| {
vec![
RACE_TIME_2021_12_P1.clone(),
RACE_TIME_2021_12_P2.clone(),
RACE_TIME_2021_12_P3.clone(),
RACE_TIME_2021_12_P10.clone(),
]
});
pub(crate) static RACE_TIMES_2023_4: LazyLock<Vec<RaceTime>> = LazyLock::new(|| {
vec![
RACE_TIME_2023_4_P1.clone(),
RACE_TIME_2023_4_P2.clone(),
RACE_TIME_2023_4_P3.clone(),
]
});
pub(crate) const SPRINT_RESULT_2023_4_P1_STR: &str = formatcp!(
r#"{{
"number": "11",
"position": "1",
"positionText": "1",
"points": "8",
"Driver": {DRIVER_PEREZ_STR},
"Constructor": {CONSTRUCTOR_RED_BULL_STR},
"grid": "2",
"laps": "17",
"status": "Finished",
"Time": {{
"millis": "1997667",
"time": "33:17.667"
}},
"FastestLap": {{
"lap": "11",
"Time": {{
"time": "1:43.616"
}}
}}
}}"#
);
pub(crate) const SPRINT_RESULT_2023_4_P3_STR: &str = formatcp!(
r#"{{
"number": "1",
"position": "3",
"positionText": "3",
"points": "6",
"Driver": {DRIVER_MAX_STR},
"Constructor": {CONSTRUCTOR_RED_BULL_STR},
"grid": "3",
"laps": "17",
"status": "Finished",
"Time": {{
"millis": "2002732",
"time": "+5.065"
}},
"FastestLap": {{
"lap": "10",
"Time": {{
"time": "1:43.723"
}}
}}
}}"#
);
pub(crate) const SPRINT_RESULT_2024_5_P20_STR: &str = formatcp!(
r#"{{
"number": "14",
"position": "20",
"positionText": "20",
"points": "0",
"Driver": {DRIVER_ALONSO_STR},
"Constructor": {CONSTRUCTOR_ASTON_MARTIN_STR},
"grid": "3",
"laps": "17",
"status": "Retired",
"Time": {{
"millis": "1779513",
"time": "+-1:57:34.853"
}},
"FastestLap": {{
"rank": "3",
"lap": "3",
"Time": {{
"time": "1:40.537"
}}
}}
}}"#
);
pub(crate) const SPRINT_RESULT_2023_4_P1: LazyLock<SprintResult> = LazyLock::new(|| SprintResult {
number: 11,
position: 1,
position_text: Position::Finished(1),
points: 8.0,
driver: DRIVER_PEREZ.clone(),
constructor: CONSTRUCTOR_RED_BULL.clone(),
grid: 2,
laps: 17,
status: "Finished".to_string(),
time: Some(RaceTime::lead(duration_millis(1997667))),
fastest_lap: Some(FastestLap {
rank: None,
lap: 11,
time: duration_m_s_ms(1, 43, 616),
average_speed: None,
}),
});
pub(crate) const SPRINT_RESULT_2023_4_P3: LazyLock<SprintResult> = LazyLock::new(|| SprintResult {
number: 1,
position: 3,
position_text: Position::Finished(3),
points: 6.0,
driver: DRIVER_MAX.clone(),
constructor: CONSTRUCTOR_RED_BULL.clone(),
grid: 3,
laps: 17,
status: "Finished".to_string(),
time: Some(RaceTime::with_delta(duration_millis(2002732), duration_m_s_ms(0, 5, 65))),
fastest_lap: Some(FastestLap {
rank: None,
lap: 10,
time: duration_m_s_ms(1, 43, 723),
average_speed: None,
}),
});
pub(crate) const SPRINT_RESULT_2024_5_P20: LazyLock<SprintResult> = LazyLock::new(|| SprintResult {
number: 14,
position: 20,
position_text: Position::Finished(20),
points: 0.0,
driver: DRIVER_ALONSO.clone(),
constructor: CONSTRUCTOR_ASTON_MARTIN.clone(),
grid: 3,
laps: 17,
status: "Retired".to_string(),
time: None, fastest_lap: Some(FastestLap {
rank: Some(3),
lap: 3,
time: duration_m_s_ms(1, 40, 537),
average_speed: None,
}),
});
pub(crate) const RACE_2023_4_SPRINT_RESULTS_STR: &str = formatcp!(
r#"{{
{RACE_2023_4_STR},
"SprintResults": [
{SPRINT_RESULT_2023_4_P1_STR},
{SPRINT_RESULT_2023_4_P3_STR}
]
}}"#
);
pub(crate) static RACE_2023_4_SPRINT_RESULTS: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::SprintResults(vec![SPRINT_RESULT_2023_4_P1.clone(), SPRINT_RESULT_2023_4_P3.clone()]),
..RACE_2023_4.clone()
});
pub(crate) const RACE_2024_5_SPRINT_RESULTS_STR: &str = formatcp!(
r#"{{
{RACE_2024_5_STR},
"SprintResults": [
{SPRINT_RESULT_2024_5_P20_STR}
]
}}"#
);
pub(crate) static RACE_2024_5_SPRINT_RESULTS: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::SprintResults(vec![SPRINT_RESULT_2024_5_P20.clone()]),
..RACE_2024_5.clone()
});
pub(crate) const RACE_RESULT_1950_5_P1_STR: &str = formatcp!(
r#"{{
"number": "10",
"position": "1",
"positionText": "1",
"points": "8",
"Driver": {DRIVER_FANGIO_STR},
"Constructor": {CONSTRUCTOR_ALFA_ROMEO_STR},
"grid": "2",
"laps": "35",
"status": "Finished",
"Time": {{
"millis": "10046000",
"time": "2:47"
}}
}}"#
);
pub(crate) const RACE_RESULT_1963_10_P23_STR: &str = formatcp!(
r#"{{
"number": "None",
"position": "23",
"positionText": "W",
"points": "0",
"Driver": {DRIVER_HAILWOOD_STR},
"Constructor": {CONSTRUCTOR_LOLA_STR},
"grid": "0",
"laps": "0",
"status": "Withdrew"
}}"#
);
pub(crate) const RACE_RESULT_1998_8_P1_STR: &str = formatcp!(
r#"{{
"number": "3",
"position": "1",
"positionText": "1",
"points": "10",
"Driver": {DRIVER_MICHAEL_STR},
"Constructor": {CONSTRUCTOR_FERRARI_STR},
"grid": "2",
"laps": "71",
"status": "Finished",
"Time": {{
"millis": "5685000",
"time": "1:34"
}}
}}"#
);
pub(crate) const RACE_RESULT_2003_4_P1_STR: &str = formatcp!(
r#"{{
"number": "1",
"position": "1",
"positionText": "1",
"points": "10",
"Driver": {DRIVER_MICHAEL_STR},
"Constructor": {CONSTRUCTOR_FERRARI_STR},
"grid": "1",
"laps": "62",
"status": "Finished",
"Time": {RACE_TIME_2003_4_P1_STR}
}}"#
);
pub(crate) const RACE_RESULT_2003_4_P2_STR: &str = formatcp!(
r#"{{
"number": "6",
"position": "2",
"positionText": "2",
"points": "8",
"Driver": {DRIVER_KIMI_STR},
"Constructor": {CONSTRUCTOR_MCLAREN_STR},
"grid": "6",
"laps": "62",
"status": "Finished",
"Time": {RACE_TIME_2003_4_P2_STR}
}}"#
);
pub(crate) const RACE_RESULT_2003_4_P19_STR: &str = formatcp!(
r#"{{
"number": "18",
"position": "19",
"positionText": "R",
"points": "0",
"Driver": {DRIVER_WILSON_STR},
"Constructor": {CONSTRUCTOR_MINARDI_STR},
"grid": "18",
"laps": "23",
"status": "Fuel rig"
}}"#
);
pub(crate) const RACE_RESULT_2020_9_P1_STR: &str = formatcp!(
r#"{{
"number": "44",
"position": "1",
"positionText": "1",
"points": "26",
"Driver": {DRIVER_HAMILTON_STR},
"Constructor": {CONSTRUCTOR_MERCEDES_STR},
"grid": "1",
"laps": "59",
"status": "Finished",
"Time": {{
"millis": "8375059",
"time": "2:19:35.060"
}},
"FastestLap": {{
"rank": "1",
"lap": "58",
"Time": {{
"time": "1:18.833"
}},
"AverageSpeed": {{
"units": "kph",
"speed": "239.518"
}}
}}
}}"#
);
pub(crate) const RACE_RESULT_2021_12_P1_STR: &str = formatcp!(
r#"{{
"number": "33",
"position": "1",
"positionText": "1",
"points": "12.5",
"Driver": {DRIVER_MAX_STR},
"Constructor": {CONSTRUCTOR_RED_BULL_STR},
"grid": "1",
"laps": "1",
"status": "Finished",
"Time": {RACE_TIME_2021_12_P1_STR}
}}"#
);
pub(crate) const RACE_RESULT_2021_12_P2_STR: &str = formatcp!(
r#"{{
"number": "63",
"position": "2",
"positionText": "2",
"points": "9",
"Driver": {DRIVER_RUSSELL_STR},
"Constructor": {CONSTRUCTOR_WILLIAMS_STR},
"grid": "2",
"laps": "1",
"status": "Finished",
"Time": {RACE_TIME_2021_12_P2_STR}
}}"#
);
pub(crate) const RACE_RESULT_2021_12_P3_STR: &str = formatcp!(
r#"{{
"number": "44",
"position": "3",
"positionText": "3",
"points": "7.5",
"Driver": {DRIVER_HAMILTON_STR},
"Constructor": {CONSTRUCTOR_MERCEDES_STR},
"grid": "3",
"laps": "1",
"status": "Finished",
"Time": {RACE_TIME_2021_12_P3_STR}
}}"#
);
pub(crate) const RACE_RESULT_2021_12_P10_STR: &str = formatcp!(
r#"{{
"number": "55",
"position": "10",
"positionText": "10",
"points": "0.5",
"Driver": {DRIVER_SAINZ_STR},
"Constructor": {CONSTRUCTOR_FERRARI_STR},
"grid": "11",
"laps": "1",
"status": "Finished",
"Time": {RACE_TIME_2021_12_P10_STR}
}}"#
);
pub(crate) const RACE_RESULT_2023_3_P15_STR: &str = formatcp!(
r#"{{
"number": "21",
"position": "15",
"positionText": "15",
"points": "0",
"Driver": {DRIVER_DE_VRIES_STR},
"Constructor": {CONSTRUCTOR_ALPHA_TAURI_STR},
"grid": "15",
"laps": "56",
"status": "Retired",
"Time": {{
"millis": "7005713",
"time": "+-1:24:07.342"
}},
"FastestLap": {{
"rank": "10",
"lap": "50",
"Time": {{
"time": "1:21.183"
}},
"AverageSpeed": {{
"units": "kph",
"speed": "234.049"
}}
}}
}}"#
);
pub(crate) const RACE_RESULT_2023_4_P1_STR: &str = formatcp!(
r#"{{
"number": "11",
"position": "1",
"positionText": "1",
"points": "25",
"Driver": {DRIVER_PEREZ_STR},
"Constructor": {CONSTRUCTOR_RED_BULL_STR},
"grid": "3",
"laps": "51",
"status": "Finished",
"Time": {RACE_TIME_2023_4_P1_STR},
"FastestLap": {{
"rank": "5",
"lap": "50",
"Time": {{
"time": "1:44.589"
}},
"AverageSpeed": {{
"units": "kph",
"speed": "206.625"
}}
}}
}}"#
);
pub(crate) const RACE_RESULT_2023_4_P2_STR: &str = formatcp!(
r#"{{
"number": "1",
"position": "2",
"positionText": "2",
"points": "18",
"Driver": {DRIVER_MAX_STR},
"Constructor": {CONSTRUCTOR_RED_BULL_STR},
"grid": "2",
"laps": "51",
"status": "Finished",
"Time": {RACE_TIME_2023_4_P2_STR},
"FastestLap": {{
"rank": "2",
"lap": "51",
"Time": {{
"time": "1:44.232"
}},
"AverageSpeed": {{
"units": "kph",
"speed": "207.333"
}}
}}
}}"#
);
pub(crate) const RACE_RESULT_2023_4_P20_STR: &str = formatcp!(
r#"{{
"number": "21",
"position": "20",
"positionText": "R",
"points": "0",
"Driver": {DRIVER_DE_VRIES_STR},
"Constructor": {CONSTRUCTOR_ALPHA_TAURI_STR},
"grid": "18",
"laps": "9",
"status": "Retired",
"FastestLap": {{
"rank": "20",
"lap": "4",
"Time": {{
"time": "1:48.781"
}},
"AverageSpeed": {{
"units": "kph",
"speed": "198.663"
}}
}}
}}"#
);
pub(crate) const RACE_RESULT_1950_5_P1: LazyLock<RaceResult> = LazyLock::new(|| RaceResult {
number: 10,
position: 1,
position_text: Position::Finished(1),
points: 8.0,
driver: DRIVER_FANGIO.clone(),
constructor: CONSTRUCTOR_ALFA_ROMEO.clone(),
grid: 2,
laps: 35,
status: "Finished".to_string(),
time: Some(RACE_TIME_1950_5_P1.clone()),
fastest_lap: None,
});
pub(crate) const RACE_RESULT_1963_10_P23: LazyLock<RaceResult> = LazyLock::new(|| RaceResult {
number: RaceResult::NO_NUMBER,
position: 23,
position_text: Position::Withdrawn,
points: 0.0,
driver: DRIVER_HAILWOOD.clone(),
constructor: CONSTRUCTOR_LOLA.clone(),
grid: 0,
laps: 0,
status: "Withdrew".to_string(),
time: None,
fastest_lap: None,
});
pub(crate) const RACE_RESULT_1998_8_P1: LazyLock<RaceResult> = LazyLock::new(|| RaceResult {
number: 3,
position: 1,
position_text: Position::Finished(1),
points: 10.0,
driver: DRIVER_MICHAEL.clone(),
constructor: CONSTRUCTOR_FERRARI.clone(),
grid: 2,
laps: 71,
status: "Finished".to_string(),
time: Some(RaceTime::lead(duration_millis(5685000))),
fastest_lap: None,
});
pub(crate) const RACE_RESULT_2003_4_P1: LazyLock<RaceResult> = LazyLock::new(|| RaceResult {
number: 1,
position: 1,
position_text: Position::Finished(1),
points: 10.0,
driver: DRIVER_MICHAEL.clone(),
constructor: CONSTRUCTOR_FERRARI.clone(),
grid: 1,
laps: 62,
status: "Finished".to_string(),
time: Some(RACE_TIME_2003_4_P1.clone()),
fastest_lap: None,
});
pub(crate) const RACE_RESULT_2003_4_P2: LazyLock<RaceResult> = LazyLock::new(|| RaceResult {
number: 6,
position: 2,
position_text: Position::Finished(2),
points: 8.0,
driver: DRIVER_KIMI.clone(),
constructor: CONSTRUCTOR_MCLAREN.clone(),
grid: 6,
laps: 62,
status: "Finished".to_string(),
time: Some(RACE_TIME_2003_4_P2.clone()),
fastest_lap: None,
});
pub(crate) const RACE_RESULT_2003_4_P19: LazyLock<RaceResult> = LazyLock::new(|| RaceResult {
number: 18,
position: 19,
position_text: Position::R,
points: 0.0,
driver: DRIVER_WILSON.clone(),
constructor: CONSTRUCTOR_MINARDI.clone(),
grid: 18,
laps: 23,
status: "Fuel rig".to_string(),
time: None,
fastest_lap: None,
});
pub(crate) const RACE_RESULT_2020_9_P1: LazyLock<RaceResult> = LazyLock::new(|| RaceResult {
number: 44,
position: 1,
position_text: Position::Finished(1),
points: 26.0,
driver: DRIVER_HAMILTON.clone(),
constructor: CONSTRUCTOR_MERCEDES.clone(),
grid: 1,
laps: 59,
status: "Finished".to_string(),
time: Some(RaceTime::lead(duration_millis(8375060))),
fastest_lap: Some(FastestLap {
rank: Some(1),
lap: 58,
time: duration_m_s_ms(1, 18, 833),
average_speed: Some(AverageSpeed {
units: SpeedUnits::Kph,
speed: 239.518,
}),
}),
});
pub(crate) const RACE_RESULT_2021_12_P1: LazyLock<RaceResult> = LazyLock::new(|| RaceResult {
number: 33,
position: 1,
position_text: Position::Finished(1),
points: 12.5,
driver: DRIVER_MAX.clone(),
constructor: CONSTRUCTOR_RED_BULL.clone(),
grid: 1,
laps: 1,
status: "Finished".to_string(),
time: Some(RACE_TIME_2021_12_P1.clone()),
fastest_lap: None,
});
pub(crate) const RACE_RESULT_2021_12_P2: LazyLock<RaceResult> = LazyLock::new(|| RaceResult {
number: 63,
position: 2,
position_text: Position::Finished(2),
points: 9.0,
driver: DRIVER_RUSSELL.clone(),
constructor: CONSTRUCTOR_WILLIAMS.clone(),
grid: 2,
laps: 1,
status: "Finished".to_string(),
time: Some(RACE_TIME_2021_12_P2.clone()),
fastest_lap: None,
});
pub(crate) const RACE_RESULT_2021_12_P3: LazyLock<RaceResult> = LazyLock::new(|| RaceResult {
number: 44,
position: 3,
position_text: Position::Finished(3),
points: 7.5,
driver: DRIVER_HAMILTON.clone(),
constructor: CONSTRUCTOR_MERCEDES.clone(),
grid: 3,
laps: 1,
status: "Finished".to_string(),
time: Some(RACE_TIME_2021_12_P3.clone()),
fastest_lap: None,
});
pub(crate) const RACE_RESULT_2021_12_P10: LazyLock<RaceResult> = LazyLock::new(|| RaceResult {
number: 55,
position: 10,
position_text: Position::Finished(10),
points: 0.5,
driver: DRIVER_SAINZ.clone(),
constructor: CONSTRUCTOR_FERRARI.clone(),
grid: 11,
laps: 1,
status: "Finished".to_string(),
time: Some(RACE_TIME_2021_12_P10.clone()),
fastest_lap: None,
});
pub(crate) const RACE_RESULT_2023_3_P15: LazyLock<RaceResult> = LazyLock::new(|| RaceResult {
number: 21,
position: 15,
position_text: Position::Finished(15),
points: 0.0,
driver: DRIVER_DE_VRIES.clone(),
constructor: CONSTRUCTOR_ALPHA_TAURI.clone(),
grid: 15,
laps: 56,
status: "Retired".to_string(),
time: None, fastest_lap: Some(FastestLap {
rank: Some(10),
lap: 50,
time: duration_m_s_ms(1, 21, 183),
average_speed: Some(AverageSpeed {
units: SpeedUnits::Kph,
speed: 234.049,
}),
}),
});
pub(crate) const RACE_RESULT_2023_4_P1: LazyLock<RaceResult> = LazyLock::new(|| RaceResult {
number: 11,
position: 1,
position_text: Position::Finished(1),
points: 25.0,
driver: DRIVER_PEREZ.clone(),
constructor: CONSTRUCTOR_RED_BULL.clone(),
grid: 3,
laps: 51,
status: "Finished".to_string(),
time: Some(RACE_TIME_2023_4_P1.clone()),
fastest_lap: Some(FastestLap {
rank: Some(5),
lap: 50,
time: duration_m_s_ms(1, 44, 589),
average_speed: Some(AverageSpeed {
units: SpeedUnits::Kph,
speed: 206.625,
}),
}),
});
pub(crate) const RACE_RESULT_2023_4_P2: LazyLock<RaceResult> = LazyLock::new(|| RaceResult {
number: 1,
position: 2,
position_text: Position::Finished(2),
points: 18.0,
driver: DRIVER_MAX.clone(),
constructor: CONSTRUCTOR_RED_BULL.clone(),
grid: 2,
laps: 51,
status: "Finished".to_string(),
time: Some(RACE_TIME_2023_4_P2.clone()),
fastest_lap: Some(FastestLap {
rank: Some(2),
lap: 51,
time: duration_m_s_ms(1, 44, 232),
average_speed: Some(AverageSpeed {
units: SpeedUnits::Kph,
speed: 207.333,
}),
}),
});
pub(crate) const RACE_RESULT_2023_4_P20: LazyLock<RaceResult> = LazyLock::new(|| RaceResult {
number: 21,
position: 20,
position_text: Position::R,
points: 0.0,
driver: DRIVER_DE_VRIES.clone(),
constructor: CONSTRUCTOR_ALPHA_TAURI.clone(),
grid: 18,
laps: 9,
status: "Retired".to_string(),
time: None,
fastest_lap: Some(FastestLap {
rank: Some(20),
lap: 4,
time: duration_m_s_ms(1, 48, 781),
average_speed: Some(AverageSpeed {
units: SpeedUnits::Kph,
speed: 198.663,
}),
}),
});
pub(crate) const RACE_1950_5_RACE_RESULTS_STR: &str = formatcp!(
r#"{{
{RACE_1950_5_STR},
"Results": [
{RACE_RESULT_1950_5_P1_STR}
]
}}"#
);
pub(crate) static RACE_1950_5_RACE_RESULTS: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::RaceResults(vec![RACE_RESULT_1950_5_P1.clone()]),
..RACE_1950_5.clone()
});
pub(crate) const RACE_1963_10_RACE_RESULTS_STR: &str = formatcp!(
r#"{{
{RACE_1963_10_STR},
"Results": [
{RACE_RESULT_1963_10_P23_STR}
]
}}"#
);
pub(crate) static RACE_1963_10_RACE_RESULTS: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::RaceResults(vec![RACE_RESULT_1963_10_P23.clone()]),
..RACE_1963_10.clone()
});
pub(crate) const RACE_1998_8_RACE_RESULTS_STR: &str = formatcp!(
r#"{{
{RACE_1998_8_STR},
"Results": [
{RACE_RESULT_1998_8_P1_STR}
]
}}"#
);
pub(crate) static RACE_1998_8_RACE_RESULTS: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::RaceResults(vec![RACE_RESULT_1998_8_P1.clone()]),
..RACE_1998_8.clone()
});
pub(crate) const RACE_2003_4_RACE_RESULTS_STR: &str = formatcp!(
r#"{{
{RACE_2003_4_STR},
"Results": [
{RACE_RESULT_2003_4_P1_STR},
{RACE_RESULT_2003_4_P2_STR},
{RACE_RESULT_2003_4_P19_STR}
]
}}"#
);
pub(crate) static RACE_2003_4_RACE_RESULTS: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::RaceResults(vec![
RACE_RESULT_2003_4_P1.clone(),
RACE_RESULT_2003_4_P2.clone(),
RACE_RESULT_2003_4_P19.clone(),
]),
..RACE_2003_4.clone()
});
pub(crate) const RACE_2020_9_RACE_RESULTS_STR: &str = formatcp!(
r#"{{
{RACE_2020_9_STR},
"Results": [
{RACE_RESULT_2020_9_P1_STR}
]
}}"#
);
pub(crate) static RACE_2020_9_RACE_RESULTS: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::RaceResults(vec![RACE_RESULT_2020_9_P1.clone()]),
..RACE_2020_9.clone()
});
pub(crate) const RACE_2021_12_RACE_RESULTS_STR: &str = formatcp!(
r#"{{
{RACE_2021_12_STR},
"Results": [
{RACE_RESULT_2021_12_P1_STR},
{RACE_RESULT_2021_12_P2_STR},
{RACE_RESULT_2021_12_P3_STR},
{RACE_RESULT_2021_12_P10_STR}
]
}}"#
);
pub(crate) static RACE_2021_12_RACE_RESULTS: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::RaceResults(vec![
RACE_RESULT_2021_12_P1.clone(),
RACE_RESULT_2021_12_P2.clone(),
RACE_RESULT_2021_12_P3.clone(),
RACE_RESULT_2021_12_P10.clone(),
]),
..RACE_2021_12.clone()
});
pub(crate) const RACE_2023_3_RACE_RESULTS_STR: &str = formatcp!(
r#"{{
{RACE_2023_3_STR},
"Results": [
{RACE_RESULT_2023_3_P15_STR}
]
}}"#
);
pub(crate) static RACE_2023_3_RACE_RESULTS: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::RaceResults(vec![RACE_RESULT_2023_3_P15.clone()]),
..RACE_2023_3.clone()
});
pub(crate) const RACE_2023_4_RACE_RESULTS_STR: &str = formatcp!(
r#"{{
{RACE_2023_4_STR},
"Results": [
{RACE_RESULT_2023_4_P1_STR},
{RACE_RESULT_2023_4_P2_STR},
{RACE_RESULT_2023_4_P20_STR}
]
}}"#
);
pub(crate) static RACE_2023_4_RACE_RESULTS: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::RaceResults(vec![
RACE_RESULT_2023_4_P1.clone(),
RACE_RESULT_2023_4_P2.clone(),
RACE_RESULT_2023_4_P20.clone(),
]),
..RACE_2023_4.clone()
});
pub(crate) const STATUS_2022_FINISHED_STR: &str = formatcp!(
r#"{{
"statusId": "1",
"count": "279",
"status": "Finished"
}}"#
);
pub(crate) const STATUS_2022_ACCIDENT_STR: &str = formatcp!(
r#"{{
"statusId": "3",
"count": "8",
"status": "Accident"
}}"#
);
pub(crate) const STATUS_2022_COLLISION_STR: &str = formatcp!(
r#"{{
"statusId": "4",
"count": "10",
"status": "Collision"
}}"#
);
pub(crate) const STATUS_2022_ENGINE_STR: &str = formatcp!(
r#"{{
"statusId": "5",
"count": "7",
"status": "Engine"
}}"#
);
pub(crate) const STATUS_2022_FINISHED: LazyLock<Status> = LazyLock::new(|| Status {
status_id: 1,
count: 279,
status: "Finished".to_string(),
});
pub(crate) const STATUS_2022_ACCIDENT: LazyLock<Status> = LazyLock::new(|| Status {
status_id: 3,
count: 8,
status: "Accident".to_string(),
});
pub(crate) const STATUS_2022_COLLISION: LazyLock<Status> = LazyLock::new(|| Status {
status_id: 4,
count: 10,
status: "Collision".to_string(),
});
pub(crate) const STATUS_2022_ENGINE: LazyLock<Status> = LazyLock::new(|| Status {
status_id: 5,
count: 7,
status: "Engine".to_string(),
});
pub(crate) const STATUS_TABLE_2022_STR: &str = formatcp!(
r#"{{
"StatusTable": {{
"Status": [
{STATUS_2022_FINISHED_STR},
{STATUS_2022_ACCIDENT_STR},
{STATUS_2022_COLLISION_STR},
{STATUS_2022_ENGINE_STR}
]
}}}}"#
);
pub(crate) static STATUS_TABLE_2022: LazyLock<Table> = LazyLock::new(|| Table::Status {
status: vec![
STATUS_2022_FINISHED.clone(),
STATUS_2022_ACCIDENT.clone(),
STATUS_2022_COLLISION.clone(),
STATUS_2022_ENGINE.clone(),
],
});
pub(crate) const TIMING_2023_4_L1_P1_STR: &str = formatcp!(
r#"{{
"driverId": "leclerc",
"position": "1",
"time": "1:50.109"
}}"#
);
pub(crate) const TIMING_2023_4_L1_P2_STR: &str = formatcp!(
r#"{{
"driverId": "max_verstappen",
"position": "2",
"time": "1:50.456"
}}"#
);
pub(crate) const TIMING_2023_4_L2_P1_STR: &str = formatcp!(
r#"{{
"driverId": "leclerc",
"position": "1",
"time": "1:47.656"
}}"#
);
pub(crate) const TIMING_2023_4_L2_P2_STR: &str = formatcp!(
r#"{{
"driverId": "max_verstappen",
"position": "2",
"time": "1:47.707"
}}"#
);
pub(crate) const TIMING_2023_4_L1_P1: LazyLock<Timing> = LazyLock::new(|| Timing {
driver_id: "leclerc".into(),
position: 1,
time: duration_m_s_ms(1, 50, 109),
});
pub(crate) const TIMING_2023_4_L1_P2: LazyLock<Timing> = LazyLock::new(|| Timing {
driver_id: "max_verstappen".into(),
position: 2,
time: duration_m_s_ms(1, 50, 456),
});
pub(crate) const TIMING_2023_4_L2_P1: LazyLock<Timing> = LazyLock::new(|| Timing {
driver_id: "leclerc".into(),
position: 1,
time: duration_m_s_ms(1, 47, 656),
});
pub(crate) const TIMING_2023_4_L2_P2: LazyLock<Timing> = LazyLock::new(|| Timing {
driver_id: "max_verstappen".into(),
position: 2,
time: duration_m_s_ms(1, 47, 707),
});
pub(crate) const LAP_2023_4_L1_STR: &str = formatcp!(
r#"{{
"number": "1",
"Timings": [
{TIMING_2023_4_L1_P1_STR},
{TIMING_2023_4_L1_P2_STR}
]
}}"#
);
pub(crate) const LAP_2023_4_L2_STR: &str = formatcp!(
r#"{{
"number": "2",
"Timings": [
{TIMING_2023_4_L2_P1_STR},
{TIMING_2023_4_L2_P2_STR}
]
}}"#
);
pub(crate) const LAP_2023_4_L1: LazyLock<Lap> = LazyLock::new(|| Lap {
number: 1,
timings: vec![TIMING_2023_4_L1_P1.clone(), TIMING_2023_4_L1_P2.clone()],
});
pub(crate) const LAP_2023_4_L2: LazyLock<Lap> = LazyLock::new(|| Lap {
number: 2,
timings: vec![TIMING_2023_4_L2_P1.clone(), TIMING_2023_4_L2_P2.clone()],
});
pub(crate) const RACE_2023_4_LAPS_STR: &str = formatcp!(
r#"{{
{RACE_2023_4_STR},
"Laps": [
{LAP_2023_4_L1_STR},
{LAP_2023_4_L2_STR}
]
}}"#
);
pub(crate) static RACE_2023_4_LAPS: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::Laps(vec![LAP_2023_4_L1.clone(), LAP_2023_4_L2.clone()]),
..RACE_2023_4.clone()
});
pub(crate) const PIT_STOP_2023_4_L10_MAX_STR: &str = formatcp!(
r#"{{
"driverId": "max_verstappen",
"lap": "10",
"stop": "1",
"time": "15:22:00",
"duration": "20.707"
}}"#
);
pub(crate) const PIT_STOP_2023_4_L11_LECLERC_STR: &str = formatcp!(
r#"{{
"driverId": "leclerc",
"lap": "11",
"stop": "1",
"time": "15:24:25",
"duration": "21.126"
}}"#
);
pub(crate) const PIT_STOP_2023_4_L10_MAX: LazyLock<PitStop> = LazyLock::new(|| PitStop {
driver_id: "max_verstappen".into(),
lap: 10,
stop: 1,
time: time!(15:22:00),
duration: duration_m_s_ms(0, 20, 707),
});
pub(crate) const PIT_STOP_2023_4_L11_LECLERC: LazyLock<PitStop> = LazyLock::new(|| PitStop {
driver_id: "leclerc".into(),
lap: 11,
stop: 1,
time: time!(15:24:25),
duration: duration_m_s_ms(0, 21, 126),
});
pub(crate) const RACE_2023_4_PIT_STOPS_STR: &str = formatcp!(
r#"{{
{RACE_2023_4_STR},
"PitStops": [
{PIT_STOP_2023_4_L10_MAX_STR},
{PIT_STOP_2023_4_L11_LECLERC_STR}
]
}}"#
);
pub(crate) static RACE_2023_4_PIT_STOPS: LazyLock<Race> = LazyLock::new(|| Race {
payload: Payload::PitStops(vec![PIT_STOP_2023_4_L10_MAX.clone(), PIT_STOP_2023_4_L11_LECLERC.clone()]),
..RACE_2023_4.clone()
});
pub(crate) static DRIVERS_BY_SEASON: LazyLock<HashMap<u32, Vec<Driver>>> = LazyLock::new(|| {
HashMap::from([
(1963, vec![DRIVER_HAILWOOD.clone(), DRIVER_ABATE.clone()]),
(
2003,
vec![
DRIVER_MICHAEL.clone(),
DRIVER_JOS.clone(),
DRIVER_RALF.clone(),
DRIVER_WILSON.clone(),
DRIVER_KIMI.clone(),
DRIVER_ALONSO.clone(),
],
),
(
2023,
vec![
DRIVER_ALONSO.clone(),
DRIVER_HAMILTON.clone(),
DRIVER_PEREZ.clone(),
DRIVER_SAINZ.clone(),
DRIVER_DE_VRIES.clone(),
DRIVER_MAX.clone(),
DRIVER_LECLERC.clone(),
DRIVER_RUSSELL.clone(),
],
),
])
});
pub(crate) static CONSTRUCTORS_BY_SEASON: LazyLock<HashMap<u32, Vec<Constructor>>> = LazyLock::new(|| {
HashMap::from([
(
1997,
vec![
CONSTRUCTOR_LOLA.clone(),
CONSTRUCTOR_MCLAREN.clone(),
CONSTRUCTOR_FERRARI.clone(),
CONSTRUCTOR_WILLIAMS.clone(),
CONSTRUCTOR_MINARDI.clone(),
],
),
(
2020,
vec![
CONSTRUCTOR_MCLAREN.clone(),
CONSTRUCTOR_FERRARI.clone(),
CONSTRUCTOR_WILLIAMS.clone(),
CONSTRUCTOR_ALPHA_TAURI.clone(),
CONSTRUCTOR_RED_BULL.clone(),
CONSTRUCTOR_MERCEDES.clone(),
],
),
])
});
pub(crate) static RACE_SCHEDULES_BY_SEASON: LazyLock<HashMap<u32, Vec<Race>>> = LazyLock::new(|| {
let mut map: HashMap<u32, Vec<Race>> = HashMap::new();
for race in RACE_TABLE_SCHEDULE.as_races().unwrap() {
if map.contains_key(&race.season) {
map.get_mut(&race.season).unwrap().push(race.clone())
} else {
let _unused = map.insert(race.season, vec![race.clone()]);
}
}
map
});
fn clone_and_merge<T: Clone>(race: &Race, payload: &T) -> Race<T> {
race.clone().map(|_| payload.clone())
}
pub(crate) static RACES_QUALIFYING_RESULTS_RED_BULL: LazyLock<Vec<Race<Vec<QualifyingResult>>>> = LazyLock::new(|| {
vec![clone_and_merge(
&RACE_2023_4,
&vec![QUALIFYING_RESULT_2023_4_P2.clone(), QUALIFYING_RESULT_2023_4_P3.clone()],
)]
});
pub(crate) static RACES_QUALIFYING_RESULT_P1: LazyLock<Vec<Race<QualifyingResult>>> = LazyLock::new(|| {
vec![
clone_and_merge(&RACE_2003_4, &QUALIFYING_RESULT_2003_4_P1),
clone_and_merge(&RACE_2023_4, &QUALIFYING_RESULT_2023_4_P1),
]
});
pub(crate) static RACES_QUALIFYING_RESULT_P2: LazyLock<Vec<Race<QualifyingResult>>> = LazyLock::new(|| {
vec![
clone_and_merge(&RACE_2003_4, &QUALIFYING_RESULT_2003_4_P2),
clone_and_merge(&RACE_2023_4, &QUALIFYING_RESULT_2023_4_P2),
clone_and_merge(&RACE_2023_12, &QUALIFYING_RESULT_2023_12_P2),
]
});
pub(crate) static RACES_2023_QUALIFYING_RESULT_CHARLES: LazyLock<Vec<Race<QualifyingResult>>> = LazyLock::new(|| {
vec![
clone_and_merge(&RACE_2023_4, &QUALIFYING_RESULT_2023_4_P1),
clone_and_merge(&RACE_2023_10, &QUALIFYING_RESULT_2023_10_P4),
clone_and_merge(&RACE_2023_12, &QUALIFYING_RESULT_2023_12_P2),
]
});
pub(crate) static RACES_SPRINT_RESULTS_RED_BULL: LazyLock<Vec<Race<Vec<SprintResult>>>> = LazyLock::new(|| {
vec![clone_and_merge(
&RACE_2023_4,
&vec![SPRINT_RESULT_2023_4_P1.clone(), SPRINT_RESULT_2023_4_P3.clone()],
)]
});
pub(crate) static RACES_SPRINT_RESULT_P1: LazyLock<Vec<Race<SprintResult>>> =
LazyLock::new(|| vec![clone_and_merge(&RACE_2023_4, &SPRINT_RESULT_2023_4_P1)]);
pub(crate) static RACES_RACE_RESULTS_RED_BULL: LazyLock<Vec<Race<Vec<RaceResult>>>> = LazyLock::new(|| {
vec![clone_and_merge(
&RACE_2023_4,
&vec![RACE_RESULT_2023_4_P1.clone(), RACE_RESULT_2023_4_P2.clone()],
)]
});
pub(crate) static RACES_RACE_RESULT_MICHAEL: LazyLock<Vec<Race<RaceResult>>> =
LazyLock::new(|| vec![clone_and_merge(&RACE_2003_4, &RACE_RESULT_2003_4_P1)]);
pub(crate) static RACES_RACE_RESULT_MAX: LazyLock<Vec<Race<RaceResult>>> = LazyLock::new(|| {
vec![
clone_and_merge(&RACE_2021_12, &RACE_RESULT_2021_12_P1),
clone_and_merge(&RACE_2023_4, &RACE_RESULT_2023_4_P2),
]
});