fix mtx parser bug: s/strip_suffix/strip_prefix/

This commit is contained in:
Dietmar Maurer 2021-01-22 11:00:56 +01:00
parent 64b83c3d70
commit 45212a8c78

View File

@ -58,7 +58,7 @@ fn parse_drive_status(i: &str) -> IResult<&str, DriveStatus> {
let mut loaded_slot = None;
if let Some(empty) = i.strip_suffix("Empty") {
if let Some(empty) = i.strip_prefix("Empty") {
return Ok((empty, DriveStatus { loaded_slot, status: ElementStatus::Empty }));
}
let (mut i, _) = tag("Full (")(i)?;