Commit 5375475d authored by Emmanuel Raviart's avatar Emmanuel Raviart

Reformat source code.

parent e7982887
Pipeline #101562 passed with stage
in 2 minutes and 21 seconds
......@@ -137,8 +137,8 @@ graphql_object!(Odj: Context |&self| {
match self.points_odj {
None => vec![],
Some(ref points_odj) => points_odj.points_odj
.iter()
.collect()
.iter()
.collect()
}
}
......
......@@ -257,7 +257,9 @@ pub fn load(
for acteur in &wrapper.export.acteurs.acteurs {
// Keep the existing "acteur", because the first wrapper contains only the current "députés",
// but it has the most details on them.
acteur_by_uid.entry(acteur.uid().to_string()).or_insert(acteur);
acteur_by_uid
.entry(acteur.uid().to_string())
.or_insert(acteur);
}
}
......@@ -332,7 +334,9 @@ pub fn load(
for wrapper in &acteurs_et_organes_wrappers {
for organe in &wrapper.export.organes.organes {
// Keep the first existing "organe", because the first wrapper is the most complete.
organe_by_uid.entry(organe.uid().to_string()).or_insert(organe);
organe_by_uid
.entry(organe.uid().to_string())
.or_insert(organe);
}
}
......
......@@ -68,13 +68,12 @@ fn main() {
let photos_dir = data_dir.join(format!("photos_deputes_{}", legislature));
let mut deputes = Vec::<&Acteur>::new();
for acteur in context.acteur_by_uid
for acteur in context
.acteur_by_uid
.values()
.map(|acteur| unsafe { mem::transmute::<*const Acteur, &Acteur>(*acteur) })
{
for mandat in
acteur.mandats(Some(&chrono::Local::today().format("%Y-%m-%d").to_string()))
{
for mandat in acteur.mandats(Some(&chrono::Local::today().format("%Y-%m-%d").to_string())) {
if let Mandat::MandatParlementaire(mandat_parlementaire) = mandat {
if let Some(legislature_mandat) = &mandat_parlementaire.legislature {
if legislature_mandat == legislature
......@@ -120,7 +119,8 @@ fn main() {
.output()
.expect("Wget failed");
if output.status.success() {
fs::rename(&photo_temp_file_path, &photo_file_path).expect("Renaming of image failed");
fs::rename(&photo_temp_file_path, &photo_file_path)
.expect("Renaming of image failed");
return;
}
if retries >= 2 {
......@@ -134,7 +134,8 @@ fn main() {
println!(" => Reusing existing image");
} else {
println!(" => Using blank image");
fs::copy(&missing_photo_file_path, &photo_file_path).expect("Copy of blank image failed");
fs::copy(&missing_photo_file_path, &photo_file_path)
.expect("Copy of blank image failed");
}
}
if photo_temp_file_path.exists() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment