From a0a8ebe03ffd6d7d9830b6e451c95f905209eb75 Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Sun, 6 Aug 2023 13:25:50 -0700 Subject: [PATCH] Add `expect()` for disabling truncation --- bindings/python/src/tokenizer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python/src/tokenizer.rs b/bindings/python/src/tokenizer.rs index f66f5d2d..d13aac2e 100644 --- a/bindings/python/src/tokenizer.rs +++ b/bindings/python/src/tokenizer.rs @@ -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