diff --git a/src/efmt/format.rs b/src/efmt/format.rs index 4e6d2e3..5dfcab8 100644 --- a/src/efmt/format.rs +++ b/src/efmt/format.rs @@ -156,7 +156,10 @@ impl Format { // Previous index of interest in the string let mut prev_idx = 0; let mut cur_item_idx = 0; - let mut cur_item = self.items[cur_item_idx].unwrap(); + let mut cur_item = match self.items[cur_item_idx] { + Some(item) => item, + None => return Err(Errors::ParseError(ParsingErrors::UnknownFormat)), + }; let mut cur_token = cur_item.token; let mut prev_item = cur_item; let mut prev_token;