mirror of
https://github.com/132nd-vWing/tacview-splitter.git
synced 2026-08-26 11:08:36 +02:00
finish error handling
This commit is contained in:
+3
-3
@@ -5,7 +5,7 @@ use std::hash::Hash;
|
||||
use crate::constants::{COMMENT, MINUS};
|
||||
use crate::tacview::{Coalition, CoalitionIDs};
|
||||
|
||||
pub fn split_into_header_and_body<S, E>(lines: &[S]) -> Result<(&[S], &[S]), ProcessingError>
|
||||
pub fn split_into_header_and_body<S>(lines: &[S]) -> Result<(&[S], &[S]), ProcessingError>
|
||||
where
|
||||
S: AsRef<str>,
|
||||
{
|
||||
@@ -15,7 +15,7 @@ where
|
||||
.as_ref()
|
||||
.chars()
|
||||
.next()
|
||||
.ok_or(ProcessingError::LineIsEmptyError)?
|
||||
.ok_or(ProcessingError::CannotSplitIntoHeaderAndBody)?
|
||||
== COMMENT
|
||||
{
|
||||
break;
|
||||
@@ -147,7 +147,7 @@ impl LineType {
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
enum ProcessingError {
|
||||
pub enum ProcessingError {
|
||||
LineIsEmptyError,
|
||||
UnknownLineType,
|
||||
CannotSplitIntoHeaderAndBody,
|
||||
|
||||
Reference in New Issue
Block a user