diff options
Diffstat (limited to 'examples/example-async-support')
| -rw-r--r-- | examples/example-async-support/Cargo.lock | 10 | ||||
| -rw-r--r-- | examples/example-async-support/src/main.rs | 7 |
2 files changed, 10 insertions, 7 deletions
diff --git a/examples/example-async-support/Cargo.lock b/examples/example-async-support/Cargo.lock index 3e23e92..83ce343 100644 --- a/examples/example-async-support/Cargo.lock +++ b/examples/example-async-support/Cargo.lock @@ -12,13 +12,13 @@ dependencies = [ [[package]] name = "just_fmt" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5454cda0d57db59778608d7a47bff5b16c6705598265869fb052b657f66cf05e" +checksum = "6170dccbc3ea15dfb7f2da964097f814aba1dd8f746d4ffc56f33245c38e6d96" [[package]] name = "mingling" -version = "0.2.0" +version = "0.3.0" dependencies = [ "mingling_core", "mingling_macros", @@ -27,14 +27,14 @@ dependencies = [ [[package]] name = "mingling_core" -version = "0.2.0" +version = "0.3.0" dependencies = [ "just_fmt", ] [[package]] name = "mingling_macros" -version = "0.2.0" +version = "0.3.0" dependencies = [ "just_fmt", "proc-macro2", diff --git a/examples/example-async-support/src/main.rs b/examples/example-async-support/src/main.rs index 847bfea..ac85aaf 100644 --- a/examples/example-async-support/src/main.rs +++ b/examples/example-async-support/src/main.rs @@ -24,6 +24,7 @@ //! ``` use mingling::{hook::ProgramHook, prelude::*}; +use std::io::Write; #[tokio::main] async fn main() { @@ -55,8 +56,10 @@ pub async fn handle_download(args: EntryDownload) -> Next { /// Renders the downloaded file name. #[renderer] // But renderers cannot use the `async` keyword -pub fn render_downloaded(result: ResultDownloaded) { - r_println!("\"{}\" downloaded.", *result); +pub fn render_downloaded(result: ResultDownloaded) -> RenderResult { + let mut render_result = RenderResult::new(); + writeln!(render_result, "\"{}\" downloaded.", *result).ok(); + render_result } // --------- IMPORTANT --------- |
