remove some unneeded trims

This commit is contained in:
Robin Appelman 2023-03-04 16:01:01 +01:00
commit c09508e9fa
2 changed files with 5 additions and 5 deletions

View file

@ -16,7 +16,7 @@
in rec { in rec {
# `nix develop` # `nix develop`
devShell = pkgs.mkShell { devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [rustc cargo bacon cargo-edit cargo-outdated clippy cargo-audit cargo-msrv valgrind]; nativeBuildInputs = with pkgs; [rustc cargo bacon cargo-edit cargo-outdated clippy cargo-audit cargo-msrv valgrind hyperfine];
}; };
}); });
} }

View file

@ -28,13 +28,13 @@ fn event_parser(input: &str) -> Result<RawEvent> {
let (input, subject) = subject_parser(&input[23..])?; let (input, subject) = subject_parser(&input[23..])?;
let (input, ty) = event_type_parser(input.trim_start())?; let (input, ty) = event_type_parser(&input[1..])?;
Ok(RawEvent { Ok(RawEvent {
date, date,
subject, subject,
ty, ty,
params: input.trim(), params: &input[1..],
}) })
} }
@ -130,8 +130,8 @@ pub fn subject_parser(input: &str) -> Result<(&str, RawSubject)> {
Ok((input, RawSubject::Team(Team::Spectator))) Ok((input, RawSubject::Team(Team::Spectator)))
} }
} else { } else {
let (system, input) = input.split_once(' ').ok_or(Error::Incomplete)?; let (system, _) = input.split_once(' ').ok_or(Error::Incomplete)?;
Ok((input, RawSubject::System(system))) Ok((&input[system.len()..], RawSubject::System(system)))
} }
} }