From 6aae0b39399ff42806c1396bfcf173e875afdb6a Mon Sep 17 00:00:00 2001 From: Donghyun Kim Date: Sun, 29 Sep 2024 23:25:04 +0900 Subject: [PATCH] Organize code snippets --- documentation/docs/state-management.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/documentation/docs/state-management.md b/documentation/docs/state-management.md index 8a3deef3..9ebb0f66 100644 --- a/documentation/docs/state-management.md +++ b/documentation/docs/state-management.md @@ -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!(); @@ -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; }