mirror of
https://github.com/hannobraun/Fornjot
synced 2025-03-02 19:15:49 +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>(
|
pub fn handle_model<Model>(
|
||||||
model: impl Deref<Target = Model>,
|
model: impl Deref<Target = Model>,
|
||||||
tolerance: impl Into<Tolerance>,
|
tolerance: impl Into<Tolerance>,
|
||||||
) -> Result<(), Error>
|
) -> Result
|
||||||
where
|
where
|
||||||
for<'r> (&'r Model, Tolerance): Triangulate,
|
for<'r> (&'r Model, Tolerance): Triangulate,
|
||||||
{
|
{
|
||||||
@ -31,6 +31,9 @@ where
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Return value of [`handle_model`]
|
||||||
|
pub type Result = std::result::Result<(), Error>;
|
||||||
|
|
||||||
/// Error returned by [`handle_model`]
|
/// Error returned by [`handle_model`]
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
|
@ -16,7 +16,7 @@ mod handle_model;
|
|||||||
|
|
||||||
pub use self::{
|
pub use self::{
|
||||||
args::Args,
|
args::Args,
|
||||||
handle_model::{handle_model, Error},
|
handle_model::{handle_model, Error, Result},
|
||||||
};
|
};
|
||||||
|
|
||||||
pub use fj_core as core;
|
pub use fj_core as core;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use fj::handle_model;
|
use fj::handle_model;
|
||||||
|
|
||||||
fn main() -> Result<(), fj::Error> {
|
fn main() -> fj::Result {
|
||||||
let cuboid = cuboid::cuboid(3., 2., 1.);
|
let cuboid = cuboid::cuboid(3., 2., 1.);
|
||||||
|
|
||||||
// The tolerance makes no difference for this model, as there aren't any
|
// The tolerance makes no difference for this model, as there aren't any
|
||||||
|
Loading…
Reference in New Issue
Block a user