Skip to content

Commit 2635863

Browse files
committed
fix: actor error trait tests
1 parent db1fc42 commit 2635863

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/actor.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,16 @@ pub use spawn::*;
6666
///
6767
/// ```
6868
/// use kameo::actor::{Actor, ActorRef, WeakActorRef};
69-
/// use kameo::error::{ActorStopReason, BoxError};
69+
/// use kameo::error::{ActorStopReason, Infallible};
7070
/// use kameo::mailbox::unbounded::UnboundedMailbox;
7171
///
7272
/// struct MyActor;
7373
///
7474
/// impl Actor for MyActor {
7575
/// type Mailbox = UnboundedMailbox<Self>;
76+
/// type Error = Infallible;
7677
///
77-
/// async fn on_start(&mut self, actor_ref: ActorRef<Self>) -> Result<(), BoxError> {
78+
/// async fn on_start(&mut self, actor_ref: ActorRef<Self>) -> Result<(), Infallible> {
7879
/// println!("actor started");
7980
/// Ok(())
8081
/// }
@@ -83,7 +84,7 @@ pub use spawn::*;
8384
/// &mut self,
8485
/// actor_ref: WeakActorRef<Self>,
8586
/// reason: ActorStopReason,
86-
/// ) -> Result<(), BoxError> {
87+
/// ) -> Result<(), Infallible> {
8788
/// println!("actor stopped");
8889
/// Ok(())
8990
/// }

src/actor/actor_ref.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -177,16 +177,17 @@ where
177177
/// use std::time::Duration;
178178
///
179179
/// use kameo::actor::{Actor, ActorRef};
180-
/// use kameo::error::BoxError;
180+
/// use kameo::error::Infallible;
181181
/// use kameo::mailbox::unbounded::UnboundedMailbox;
182182
/// use tokio::time::sleep;
183183
///
184184
/// struct MyActor;
185185
///
186186
/// impl Actor for MyActor {
187187
/// type Mailbox = UnboundedMailbox<Self>;
188+
/// type Error = Infallible;
188189
///
189-
/// async fn on_start(&mut self, actor_ref: ActorRef<Self>) -> Result<(), BoxError> {
190+
/// async fn on_start(&mut self, actor_ref: ActorRef<Self>) -> Result<(), Infallible> {
190191
/// sleep(Duration::from_secs(2)).await; // Some io operation
191192
/// Ok(())
192193
/// }

0 commit comments

Comments
 (0)