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(),