Skip to content

Commit

Permalink
Add must_use attributes on futures.
Browse files Browse the repository at this point in the history
Prior to that there would be no warning when forgetting to use `(try_)syscall`.
  • Loading branch information
sosthene-nitrokey committed Feb 21, 2024
1 parent 159275f commit d2f8784
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ pub trait PollClient {
}
}

#[must_use = "Syscalls must be polled with the `syscall` macro"]
pub struct FutureResult<'c, T, C: ?Sized>
where
C: PollClient,
Expand Down
1 change: 1 addition & 0 deletions src/serde_extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ where
/// A result returned by [`ExtensionClient`][] and clients using it.
pub type ExtensionResult<'a, E, T, C> = Result<ExtensionFutureResult<'a, E, T, C>, ClientError>;

#[must_use = "Syscalls must be polled with the `syscall` macro"]
/// A future of an [`ExtensionResult`][].
pub struct ExtensionFutureResult<'c, E, T, C: ?Sized> {
client: &'c mut C,
Expand Down

0 comments on commit d2f8784

Please sign in to comment.