cartesi / dave

Cartesi fraud-proof system
Apache License 2.0
13 stars 11 forks source link

Get rid of `Box<dyn Error>` #29

Closed stephenctw closed 2 months ago

stephenctw commented 3 months ago

Use anyhow crate (easiest, and it's probably ok), or by generating specific error types with thiserr. Or create an associated type:

trait T {
    type Error;

    async fn foo(
         &self,
    ) -> Result<(), Self::Error>;
}

struct S {}

impl T for S {
    type Error = MyConcreteError;
    // ...
}