Skip to content

Commit

Permalink
Merge pull request #604 from chrisprice/improve-error-handling-feedback
Browse files Browse the repository at this point in the history
Improve Error::InvalidExtension message & docs
  • Loading branch information
hannobraun authored May 19, 2022
2 parents 728ba1f + c7bafad commit e5106e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/fj-export/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub fn export(mesh: &Mesh<Point<3>>, path: &Path) -> Result<(), Error> {
export_stl(mesh, path)
}
Some(extension) => Err(Error::InvalidExtension(
extension.to_str().map(|s| s.to_string()),
extension.to_string_lossy().into_owned(),
)),
None => Err(Error::NoExtension),
}
Expand Down Expand Up @@ -119,9 +119,9 @@ pub enum Error {
#[error("no extension specified")]
NoExtension,

/// Unrecognised extension found `{0:?}`
/// Unrecognised extension found
#[error("unrecognised extension found `{0:?}`")]
InvalidExtension(Option<String>),
InvalidExtension(String),

/// I/O error whilst exporting to file
#[error("I/O error whilst exporting to file")]
Expand Down

0 comments on commit e5106e7

Please sign in to comment.