aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md6
-rw-r--r--tests/tests.rs4
2 files changed, 5 insertions, 5 deletions
diff --git a/README.md b/README.md
index 6067520..d39bd8e 100644
--- a/README.md
+++ b/README.md
@@ -180,7 +180,7 @@ with a dynamized supertrait, you have to tell dynamize about it with the
```rust ignore
#[dynamize::dynamize]
trait Client {
- type Error: Into<SuperError>;
+ type Error: std::error::Error;
fn get(&self, url: String) -> Result<Vec<u8>, Self::Error>;
}
@@ -188,7 +188,7 @@ trait Client {
#[dynamize::dynamize]
#[dynamized(Client)]
trait ClientWithCache: Client {
- type Error: Into<SuperError>;
+ type Error: std::error::Error;
fn get_with_cache<C: Cache>(
&self,
@@ -208,7 +208,7 @@ second trait to:
```rust ignore
#[dynamize::dynamize]
#[dynamized(Client)]
-#[convert = |x: <Self as Client>::Error| -> SuperError {x.into()}]
+#[convert = |x: <Self as Client>::Error| -> Box<dyn std::error::Error + '_> {Box::new(x) as _}]
trait ClientWithCache: Client {
fn get_with_cache<C: Cache>(
&self,
diff --git a/tests/tests.rs b/tests/tests.rs
index aa5e996..41ed98c 100644
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -306,13 +306,13 @@ struct SuperError;
trait Cache {}
#[dynamize::dynamize]
trait Client {
- type Error: Into<SuperError>;
+ type Error: std::error::Error;
fn get(&self, url: String) -> Result<Vec<u8>, Self::Error>;
}
#[dynamize::dynamize]
#[dynamized(Client)]
-#[convert = |x: <Self as Client>::Error| -> SuperError {x.into()}]
+#[convert = |x: <Self as Client>::Error| -> Box<dyn std::error::Error + '_> {Box::new(x) as _}]
trait ClientWithCache: Client {
fn get_with_cache<C: Cache>(
&self,