Skip to content

Commit

Permalink
Merge pull request #4 from cdbfoster/strip-informational-marks
Browse files Browse the repository at this point in the history
Don't die when parsing informational marks on the end of move strings.
  • Loading branch information
MortenLohne authored Feb 1, 2024
2 parents b65df8c + 62597e1 commit 24a842c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/position/mv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ impl<const S: usize> Move<S> {
}

pub fn from_string(input: &str) -> Result<Self, pgn_traits::Error> {
// Trim crush notation
let input = input.trim_end_matches('*');
if input.len() < 2 {
return Err(pgn_traits::Error::new(
pgn_traits::ErrorKind::ParseError,
Expand Down

0 comments on commit 24a842c

Please sign in to comment.