mirror of
https://github.com/132nd-vWing/tacview-splitter.git
synced 2026-10-25 08:39: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());
|
||||
old_line = processed;
|
||||
}
|
||||
sanity_check(&result, body);
|
||||
sanity_check(&result, body)?;
|
||||
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() {
|
||||
println!("Warning: data is inconsistent");
|
||||
println!("{}", v1.len());
|
||||
println!("{}", v2.len());
|
||||
bail!("Warning: data is inconsistent\n{}\n{}", v1.len(), v2.len())
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
struct Line {
|
||||
|
||||
Reference in new issue
Block a user