From 12e339881041b0eab22f970bb52faca169a1c33c Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Fri, 20 Sep 2024 18:57:47 +0900 Subject: [PATCH] Handle wrong file path --- src/rust/src/lib.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/rust/src/lib.rs b/src/rust/src/lib.rs index 2ab7d2e..f58b8bd 100644 --- a/src/rust/src/lib.rs +++ b/src/rust/src/lib.rs @@ -25,10 +25,7 @@ fn string2any_family( ) -> savvy::Result { let mut builder = builder::LyonPathBuilder::new(tolerance as _, line_width as _); - let res = builder.outline(text, font_family, font_weight, font_style); - if let Err(e) = res { - return Err(savvy::Error::new(&e.to_string())); - } + builder.outline(text, font_family, font_weight, font_style)?; let result = match ct { ConversionType::Path => builder.into_path(), @@ -48,7 +45,7 @@ fn string2any_file( ) -> savvy::Result { let mut builder = builder::LyonPathBuilder::new(tolerance as _, line_width as _); - builder.outline_from_file(text, font_file).unwrap(); + builder.outline_from_file(text, font_file)?; let result = match ct { ConversionType::Path => builder.into_path(),