Skip to content

Commit

Permalink
add StopReason::is_ok()
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoskal committed Oct 4, 2024
1 parent 6a4380c commit a99d152
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions parser/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,16 @@ impl StopReason {
.unwrap()
.to_string()
}

pub fn is_ok(&self) -> bool {
matches!(
self,
StopReason::NotStopped
| StopReason::EndOfSentence
| StopReason::NoExtension
| StopReason::NoExtensionBias
)
}
}

#[derive(Clone, Serialize, Deserialize, Debug)]
Expand Down

0 comments on commit a99d152

Please sign in to comment.