From 2e4aefa7fc19e4d66152332d28baafe1349c1636 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Thu, 26 Jan 2023 16:10:45 -0800 Subject: Annotate `Command` and `Subscription` with `#[must_use]` Calling a function returning one of these types without using it is almost certainly a mistake. Luckily Rust's `#[must_use]` can help warn about this. --- native/src/command.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'native/src/command.rs') diff --git a/native/src/command.rs b/native/src/command.rs index 89ee7375..ca9d0b64 100644 --- a/native/src/command.rs +++ b/native/src/command.rs @@ -11,6 +11,7 @@ use std::fmt; use std::future::Future; /// A set of asynchronous actions to be performed by some runtime. +#[must_use = "`Command` must be returned to runtime to take effect"] pub struct Command(iced_futures::Command>); impl Command { -- cgit