From 88d862b2a19b319b5d46260c2f7bf7cdde0199c0 Mon Sep 17 00:00:00 2001 From: Arthur Date: Tue, 14 Nov 2023 17:04:32 +0100 Subject: [PATCH] nits --- bindings/python/src/pre_tokenizers.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/bindings/python/src/pre_tokenizers.rs b/bindings/python/src/pre_tokenizers.rs index 84414f652..0fd9e9d40 100644 --- a/bindings/python/src/pre_tokenizers.rs +++ b/bindings/python/src/pre_tokenizers.rs @@ -536,14 +536,10 @@ impl PyMetaspace { // If a prepend scheme is provided, set it if let Some(prepend_scheme) = prepend_scheme { - match _from_string(prepend_scheme) { - Ok(prepend_scheme_enum) => { - new_instance.set_prepend_scheme(prepend_scheme_enum); - } - Err(err) => { - // Handle the error, you can return it or exit the function - return Err(err.into()); - } + if let Ok(prepend_scheme_enum) = _from_string(prepend_scheme) { + new_instance.set_prepend_scheme(prepend_scheme_enum); + } else { + return Err(err); } } Ok((PyMetaspace {}, new_instance.into()))