Made it not crash
This commit is contained in:
parent
9406f7725e
commit
08478b53d0
|
@ -179,7 +179,10 @@ pub fn parse(text: &str) -> ParseResult<VecDeque<Line>> {
|
|||
}
|
||||
|
||||
// Parse command component.
|
||||
let end_idx = find_index(line, ' ', idx).unwrap();
|
||||
let end_idx = match find_index(line, ' ', idx) {
|
||||
Some(val) => val,
|
||||
None => return Err(ParseError { details: "Couldn't find index of ' '".to_string() }),
|
||||
};
|
||||
let command = &line[idx..end_idx];
|
||||
idx = end_idx + 1;
|
||||
|
||||
|
|
Loading…
Reference in a new issue