Skip to content

Commit

Permalink
Handle wrong file path
Browse files Browse the repository at this point in the history
  • Loading branch information
yutannihilation committed Sep 20, 2024
1 parent d3f23bf commit 12e3398
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ fn string2any_family(
) -> savvy::Result<savvy::Sexp> {
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(),
Expand All @@ -48,7 +45,7 @@ fn string2any_file(
) -> savvy::Result<savvy::Sexp> {
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(),
Expand Down

0 comments on commit 12e3398

Please sign in to comment.