Skip to content

Commit

Permalink
Organize code snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
temeddix committed Sep 29, 2024
1 parent 1984ef3 commit 6aae0b3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions documentation/docs/state-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Here’s a basic example using the [`messages`](https://crates.io/crates/message

```rust title="native/hub/src/lib.rs"
use messages::prelude::*;
use rinf::debug_print;

rinf::write_interface!();

Expand Down Expand Up @@ -48,10 +49,10 @@ impl Calculator {
#[tokio::main]
async fn main() {
let mut addr = Calculator::start();
let res = addr.send(Sum(10, 5)).await;
match res {
Ok(result) => println!("SUM: {}", result),
_ => println!("Communication to the actor has failed"),
let result = addr.send(Sum(10, 5)).await;
match result {
Ok(inner) => debug_print!("SUM: {}", inner),
_ => debug_print!("Communication to the actor has failed"),
}
rinf::dart_shutdown().await;
}
Expand Down

0 comments on commit 6aae0b3

Please sign in to comment.