mirror of
https://github.com/0x5eal/chrono-lc.git
synced 2024-12-13 13:30:39 +00:00
chore: please the clippy overlords - 1
This commit is contained in:
parent
3025d4721a
commit
50168ae609
1 changed files with 40 additions and 45 deletions
85
build.rs
85
build.rs
|
@ -59,76 +59,71 @@ fn main() {
|
||||||
if let Ok(locale_data) = load_locale(&entry) {
|
if let Ok(locale_data) = load_locale(&entry) {
|
||||||
if let Some(long_months) = locale_data.long_months {
|
if let Some(long_months) = locale_data.long_months {
|
||||||
if long_months.len() == 12 {
|
if long_months.len() == 12 {
|
||||||
let _ = f
|
f.write_all(
|
||||||
.write_all(
|
format!(
|
||||||
format!(
|
"res.long_months.insert(\"{}\".into(), vec![{}]);\n",
|
||||||
"res.long_months.insert(\"{}\".into(), vec![{}]);\n",
|
locale_name,
|
||||||
locale_name,
|
long_months.iter().map(|s| format!("\"{}\"", s)).collect::<Vec<String>>().join(",")
|
||||||
long_months.iter().map(|s| format!("\"{}\"", s)).collect::<Vec<String>>().join(",")
|
|
||||||
)
|
|
||||||
.as_bytes(),
|
|
||||||
)
|
)
|
||||||
.unwrap();
|
.as_bytes(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(short_months) = locale_data.short_months {
|
if let Some(short_months) = locale_data.short_months {
|
||||||
if short_months.len() == 12 {
|
if short_months.len() == 12 {
|
||||||
let _ = f
|
f.write_all(
|
||||||
.write_all(
|
format!(
|
||||||
format!(
|
"res.short_months.insert(\"{}\".into(), vec![{}]);\n",
|
||||||
"res.short_months.insert(\"{}\".into(), vec![{}]);\n",
|
locale_name,
|
||||||
locale_name,
|
short_months.iter().map(|s| format!("\"{}\"", s)).collect::<Vec<String>>().join(",")
|
||||||
short_months.iter().map(|s| format!("\"{}\"", s)).collect::<Vec<String>>().join(",")
|
|
||||||
)
|
|
||||||
.as_bytes(),
|
|
||||||
)
|
)
|
||||||
.unwrap();
|
.as_bytes(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(long_weekdays) = locale_data.long_weekdays {
|
if let Some(long_weekdays) = locale_data.long_weekdays {
|
||||||
if long_weekdays.len() == 7 {
|
if long_weekdays.len() == 7 {
|
||||||
let _ = f
|
f.write_all(
|
||||||
.write_all(
|
format!(
|
||||||
format!(
|
"res.long_weekdays.insert(\"{}\".into(), vec![{}]);\n",
|
||||||
"res.long_weekdays.insert(\"{}\".into(), vec![{}]);\n",
|
locale_name,
|
||||||
locale_name,
|
long_weekdays.iter().map(|s| format!("\"{}\"", s)).collect::<Vec<String>>().join(",")
|
||||||
long_weekdays.iter().map(|s| format!("\"{}\"", s)).collect::<Vec<String>>().join(",")
|
|
||||||
)
|
|
||||||
.as_bytes(),
|
|
||||||
)
|
)
|
||||||
.unwrap();
|
.as_bytes(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(short_weekdays) = locale_data.short_weekdays {
|
if let Some(short_weekdays) = locale_data.short_weekdays {
|
||||||
if short_weekdays.len() == 7 {
|
if short_weekdays.len() == 7 {
|
||||||
let _ = f
|
f.write_all(
|
||||||
.write_all(
|
format!(
|
||||||
format!(
|
"res.short_weekdays.insert(\"{}\".into(), vec![{}]);\n",
|
||||||
"res.short_weekdays.insert(\"{}\".into(), vec![{}]);\n",
|
locale_name,
|
||||||
locale_name,
|
short_weekdays.iter().map(|s| format!("\"{}\"", s)).collect::<Vec<String>>().join(",")
|
||||||
short_weekdays.iter().map(|s| format!("\"{}\"", s)).collect::<Vec<String>>().join(",")
|
|
||||||
)
|
|
||||||
.as_bytes(),
|
|
||||||
)
|
)
|
||||||
.unwrap();
|
.as_bytes(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(ampm) = locale_data.ampm {
|
if let Some(ampm) = locale_data.ampm {
|
||||||
if ampm.len() == 4 {
|
if ampm.len() == 4 {
|
||||||
let _ = f
|
f.write_all(
|
||||||
.write_all(
|
format!(
|
||||||
format!(
|
"res.ampm.insert(\"{}\".into(), vec![{}]);\n",
|
||||||
"res.ampm.insert(\"{}\".into(), vec![{}]);\n",
|
locale_name,
|
||||||
locale_name,
|
ampm.iter().map(|s| format!("\"{}\"", s)).collect::<Vec<String>>().join(",")
|
||||||
ampm.iter().map(|s| format!("\"{}\"", s)).collect::<Vec<String>>().join(",")
|
|
||||||
)
|
|
||||||
.as_bytes(),
|
|
||||||
)
|
)
|
||||||
.unwrap();
|
.as_bytes(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue