mirror of
https://github.com/132nd-vWing/tacview-splitter.git
synced 2026-08-26 06:48:36 +02:00
propagate error from sanity_check
This commit is contained in:
+4
-5
@@ -43,16 +43,15 @@ where
|
|||||||
result.push(processed.coalition.clone());
|
result.push(processed.coalition.clone());
|
||||||
old_line = processed;
|
old_line = processed;
|
||||||
}
|
}
|
||||||
sanity_check(&result, body);
|
sanity_check(&result, body)?;
|
||||||
Ok(result)
|
Ok(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn sanity_check<S, T>(v1: &[S], v2: &[T]) {
|
fn sanity_check<S, T>(v1: &[S], v2: &[T]) -> Result<()> {
|
||||||
if v1.len() != v2.len() {
|
if v1.len() != v2.len() {
|
||||||
println!("Warning: data is inconsistent");
|
bail!("Warning: data is inconsistent\n{}\n{}", v1.len(), v2.len())
|
||||||
println!("{}", v1.len());
|
|
||||||
println!("{}", v2.len());
|
|
||||||
}
|
}
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Line {
|
struct Line {
|
||||||
|
|||||||
Reference in New Issue
Block a user