Add fj::Result

This commit is contained in:
Hanno Braun 2023-06-06 11:18:06 +02:00
parent aab2de7640
commit 9da5b5e2d8
3 changed files with 6 additions and 3 deletions

View File

@ -15,7 +15,7 @@ use crate::Args;
pub fn handle_model<Model>(
model: impl Deref<Target = Model>,
tolerance: impl Into<Tolerance>,
) -> Result<(), Error>
) -> Result
where
for<'r> (&'r Model, Tolerance): Triangulate,
{
@ -31,6 +31,9 @@ where
Ok(())
}
/// Return value of [`handle_model`]
pub type Result = std::result::Result<(), Error>;
/// Error returned by [`handle_model`]
#[derive(Debug, thiserror::Error)]
pub enum Error {

View File

@ -16,7 +16,7 @@ mod handle_model;
pub use self::{
args::Args,
handle_model::{handle_model, Error},
handle_model::{handle_model, Error, Result},
};
pub use fj_core as core;

View File

@ -1,6 +1,6 @@
use fj::handle_model;
fn main() -> Result<(), fj::Error> {
fn main() -> fj::Result {
let cuboid = cuboid::cuboid(3., 2., 1.);
// The tolerance makes no difference for this model, as there aren't any