Skip to content

Commit

Permalink
Improve Error::InvalidExtension message & docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisprice committed May 18, 2022
1 parent 728ba1f commit c7bafad
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 c7bafad

Please sign in to comment.