mirror of
https://github.com/132nd-vWing/tacview-splitter.git
synced 2026-10-25 06:49:49 +01:00
propagate error from sanity_check
This commit is contained in:
1 parent
ea81556898
commit
e51e57505e
1 file changed
+4
-5
+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