Python - Improved example with custom components

This commit is contained in:
Anthony MOI
2020-09-21 14:30:52 -04:00
committed by Anthony MOI
parent 0a930ef1d8
commit b1097a988f
5 changed files with 50 additions and 75 deletions

View File

@ -7,6 +7,7 @@ use tokenizers::tokenizer::Result;
#[derive(Debug)]
pub struct PyError(pub String);
impl PyError {
#[allow(dead_code)]
pub fn from(s: &str) -> Self {
PyError(String::from(s))
}