mirror of
https://github.com/hannobraun/Fornjot
synced 2025-03-01 18:45:59 +00:00
Add fj::Result
This commit is contained in:
parent
aab2de7640
commit
9da5b5e2d8
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user