Fix I am alive warnings
@@ -65,25 +65,25 @@ In order to define an actor you need to define a struct and have it implement
the [`Actor`](https://actix.github.io/actix/actix/trait.Actor.html) trait.
```rust
-use actix::{Actor, Addr, Context, System};
+use actix::{Actor, Context, System};
struct MyActor;
impl Actor for MyActor {
type Context = Context<Self>;
- fn started(&mut self, ctx: &mut Self::Context) {
+ fn started(&mut self, _ctx: &mut Self::Context) {
println!("I am alive!");
System::current().stop(); // <- stop system
}
}
fn main() {
- let mut system = System::new();
+ let system = System::new();
- let addr = system.block_on(async { MyActor.start() });
+ let _addr = system.block_on(async { MyActor.start() });
- system.run();
+ system.run().unwrap();
}
```
@@ -124,7 +124,7 @@ impl Actor for Calculator {
impl Handler<Sum> for Calculator {
type Result = usize; // <- Message response type
- fn handle(&mut self, msg: Sum, ctx: &mut Context<Self>) -> Self::Result {
+ fn handle(&mut self, msg: Sum, _ctx: &mut Context<Self>) -> Self::Result {
msg.0 + msg.1
}
}
@@ -196,11 +196,11 @@ impl Handler<Ping> for Game {
}
fn main() {
- let mut system = System::new();
+ let system = System::new();
// To get a Recipient object, we need to use a different builder method
// which will allow postponing actor creation
- let addr = system.block_on(async {
+ let _addr = system.block_on(async {
Game::create(|ctx| {
// now we can get an address of the first actor and create the second actor
let addr = ctx.address();
@@ -224,7 +224,7 @@ fn main() {
});
});
- system.run();
+ system.run().unwrap();
}
```
