mirror of
https://github.com/pcvolkmer/bzkf-rwdp-check.git
synced 2025-04-19 19:16:51 +00:00
refactor: Extract func to print list of missing messages
This commit is contained in:
parent
2ef4ec4c90
commit
f48a96e64d
26
src/main.rs
26
src/main.rs
@ -498,6 +498,16 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
.to_string(),
|
.to_string(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
fn print_missing_ids(missing_ids: &[&String], term: &Term) {
|
||||||
|
missing_ids.iter().sorted().for_each(|&item| {
|
||||||
|
let _ = term.write_line(&format!(
|
||||||
|
"{} ({})",
|
||||||
|
item,
|
||||||
|
to_database_id(item).unwrap_or("?".into())
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if db_meldungen.len() != xml_meldungen.len() {
|
if db_meldungen.len() != xml_meldungen.len() {
|
||||||
let _ = term.write_line(
|
let _ = term.write_line(
|
||||||
&style("\nNicht übereinstimmende Anzahl an Meldungen:")
|
&style("\nNicht übereinstimmende Anzahl an Meldungen:")
|
||||||
@ -522,13 +532,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
.to_string(),
|
.to_string(),
|
||||||
);
|
);
|
||||||
|
|
||||||
missing_db_ids.iter().sorted().for_each(|&item| {
|
print_missing_ids(&missing_db_ids, &term);
|
||||||
let _ = term.write_line(&format!(
|
|
||||||
"{} ({})",
|
|
||||||
item,
|
|
||||||
to_database_id(item).unwrap_or("?".into())
|
|
||||||
));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if !missing_xml_ids.is_empty() {
|
if !missing_xml_ids.is_empty() {
|
||||||
@ -538,13 +542,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
.to_string(),
|
.to_string(),
|
||||||
);
|
);
|
||||||
|
|
||||||
missing_xml_ids.iter().sorted().for_each(|&item| {
|
print_missing_ids(&missing_xml_ids, &term);
|
||||||
let _ = term.write_line(&format!(
|
|
||||||
"{} ({})",
|
|
||||||
item,
|
|
||||||
to_database_id(item).unwrap_or("?".into())
|
|
||||||
));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user