From 5a701070207219f6b7c717a1f4084c6fb744bd1a Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Wed, 13 Sep 2023 18:10:14 +0530 Subject: [PATCH] chore: format with rustfmt - 1 --- build.rs | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/build.rs b/build.rs index 7817be4..ee78380 100644 --- a/build.rs +++ b/build.rs @@ -11,7 +11,6 @@ use std::io::{Error as IoError, Read, Write}; use std::path::Path; use walkdir::{DirEntry, WalkDir}; - #[derive(Deserialize)] pub struct Locale { short_months: Option>, @@ -27,9 +26,7 @@ fn main() { let mut f = File::create(&dest_path).unwrap(); let _ = f.write_all( - r#####" - #![cfg_attr(rustfmt, rustfmt_skip)] - + r#####"// This file is @generated automatically by chrono_lc. Please don't edit by hand. lazy_static! { pub static ref LOCALES: Locales = { let mut res = Locales { @@ -68,8 +65,10 @@ fn main() { "res.long_months.insert(\"{}\".into(), vec![{}]);\n", locale_name, long_months.iter().map(|s| format!("\"{}\"", s)).collect::>().join(",") - ).as_bytes(), - ).unwrap(); + ) + .as_bytes(), + ) + .unwrap(); } } @@ -81,8 +80,10 @@ fn main() { "res.short_months.insert(\"{}\".into(), vec![{}]);\n", locale_name, short_months.iter().map(|s| format!("\"{}\"", s)).collect::>().join(",") - ).as_bytes(), - ).unwrap(); + ) + .as_bytes(), + ) + .unwrap(); } } @@ -94,8 +95,10 @@ fn main() { "res.long_weekdays.insert(\"{}\".into(), vec![{}]);\n", locale_name, long_weekdays.iter().map(|s| format!("\"{}\"", s)).collect::>().join(",") - ).as_bytes(), - ).unwrap(); + ) + .as_bytes(), + ) + .unwrap(); } } @@ -107,8 +110,10 @@ fn main() { "res.short_weekdays.insert(\"{}\".into(), vec![{}]);\n", locale_name, short_weekdays.iter().map(|s| format!("\"{}\"", s)).collect::>().join(",") - ).as_bytes(), - ).unwrap(); + ) + .as_bytes(), + ) + .unwrap(); } } @@ -120,8 +125,10 @@ fn main() { "res.ampm.insert(\"{}\".into(), vec![{}]);\n", locale_name, ampm.iter().map(|s| format!("\"{}\"", s)).collect::>().join(",") - ).as_bytes(), - ).unwrap(); + ) + .as_bytes(), + ) + .unwrap(); } } } @@ -134,6 +141,8 @@ fn main() { "#### .as_bytes(), ); + + println!("Formatting..."); } fn load_locale(entry: &DirEntry) -> Result {