Add expect() for disabling truncation

This commit is contained in:
Connor Boyle
2023-08-06 13:25:50 -07:00
parent efea6c7246
commit a0a8ebe03f

View File

@ -721,7 +721,7 @@ impl PyTokenizer {
/// Disable truncation
#[pyo3(text_signature = "(self)")]
fn no_truncation(&mut self) {
let _ = self.tokenizer.with_truncation(None);
self.tokenizer.with_truncation(None).expect("Failed to set truncation to `None`! This should never happen");
}
/// Get the currently set truncation parameters