Add #[must_use] to remaining core functions

This commit is contained in:
John Kugelman
2021-10-14 18:54:55 -04:00
parent e1e9319d93
commit 68b0d86294
25 changed files with 52 additions and 1 deletions

View File

@@ -167,6 +167,7 @@ impl<'a> Context<'a> {
/// Returns a reference to the `Waker` for the current task.
#[stable(feature = "futures_api", since = "1.36.0")]
#[must_use]
#[inline]
pub fn waker(&self) -> &'a Waker {
&self.waker
@@ -242,6 +243,7 @@ impl Waker {
///
/// This function is primarily used for optimization purposes.
#[inline]
#[must_use]
#[stable(feature = "futures_api", since = "1.36.0")]
pub fn will_wake(&self, other: &Waker) -> bool {
self.waker == other.waker