@@ -33,8 +33,7 @@ impl PyEncoding {
3333 fn __getstate__ ( & self , py : Python ) -> PyResult < PyObject > {
3434 let data = serde_json:: to_string ( & self . encoding ) . map_err ( |e| {
3535 exceptions:: PyException :: new_err ( format ! (
36- "Error while attempting to pickle Encoding: {}" ,
37- e
36+ "Error while attempting to pickle Encoding: {e}"
3837 ) )
3938 } ) ?;
4039 Ok ( PyBytes :: new ( py, data. as_bytes ( ) ) . into ( ) )
@@ -45,8 +44,7 @@ impl PyEncoding {
4544 Ok ( s) => {
4645 self . encoding = serde_json:: from_slice ( s) . map_err ( |e| {
4746 exceptions:: PyException :: new_err ( format ! (
48- "Error while attempting to unpickle Encoding: {}" ,
49- e
47+ "Error while attempting to unpickle Encoding: {e}"
5048 ) )
5149 } ) ?;
5250 Ok ( ( ) )
@@ -407,17 +405,16 @@ impl PyEncoding {
407405 "left" => Ok ( PaddingDirection :: Left ) ,
408406 "right" => Ok ( PaddingDirection :: Right ) ,
409407 other => Err ( PyError ( format ! (
410- "Unknown `direction`: `{}`. Use \
411- one of `left` or `right`",
412- other
408+ "Unknown `direction`: `{other}`. Use \
409+ one of `left` or `right`"
413410 ) )
414411 . into_pyerr :: < exceptions:: PyValueError > ( ) ) ,
415412 } ?;
416413 }
417414 "pad_id" => pad_id = value. extract ( ) ?,
418415 "pad_type_id" => pad_type_id = value. extract ( ) ?,
419416 "pad_token" => pad_token = value. extract ( ) ?,
420- _ => println ! ( "Ignored unknown kwarg option {}" , key ) ,
417+ _ => println ! ( "Ignored unknown kwarg option {key}" ) ,
421418 }
422419 }
423420 }
@@ -446,11 +443,10 @@ impl PyEncoding {
446443 let tdir = match direction {
447444 "left" => Ok ( TruncationDirection :: Left ) ,
448445 "right" => Ok ( TruncationDirection :: Right ) ,
449- _ => Err ( PyError ( format ! (
450- "Invalid truncation direction value : {}" ,
451- direction
452- ) )
453- . into_pyerr :: < exceptions:: PyValueError > ( ) ) ,
446+ _ => Err (
447+ PyError ( format ! ( "Invalid truncation direction value : {direction}" ) )
448+ . into_pyerr :: < exceptions:: PyValueError > ( ) ,
449+ ) ,
454450 } ?;
455451
456452 self . encoding . truncate ( max_length, stride, tdir) ;
0 commit comments