From 4bb0a5ed7ff9f959c1a61f43dd796c3f18e8b260 Mon Sep 17 00:00:00 2001 From: EFanZh Date: Tue, 7 Feb 2023 00:57:43 +0800 Subject: [PATCH] Inline `Poll` methods --- library/core/src/task/poll.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/core/src/task/poll.rs b/library/core/src/task/poll.rs index 25b61c0e66641..af5bf441bb25f 100644 --- a/library/core/src/task/poll.rs +++ b/library/core/src/task/poll.rs @@ -45,6 +45,7 @@ impl Poll { /// assert_eq!(poll_some_len, Poll::Ready(13)); /// ``` #[stable(feature = "futures_api", since = "1.36.0")] + #[inline] pub fn map(self, f: F) -> Poll where F: FnOnce(T) -> U, @@ -144,6 +145,7 @@ impl Poll> { /// assert_eq!(squared, Poll::Ready(Ok(144))); /// ``` #[stable(feature = "futures_api", since = "1.36.0")] + #[inline] pub fn map_ok(self, f: F) -> Poll> where F: FnOnce(T) -> U, @@ -171,6 +173,7 @@ impl Poll> { /// assert_eq!(res, Poll::Ready(Err(0))); /// ``` #[stable(feature = "futures_api", since = "1.36.0")] + #[inline] pub fn map_err(self, f: F) -> Poll> where F: FnOnce(E) -> U, @@ -199,6 +202,7 @@ impl Poll>> { /// assert_eq!(squared, Poll::Ready(Some(Ok(144)))); /// ``` #[stable(feature = "poll_map", since = "1.51.0")] + #[inline] pub fn map_ok(self, f: F) -> Poll>> where F: FnOnce(T) -> U, @@ -228,6 +232,7 @@ impl Poll>> { /// assert_eq!(res, Poll::Ready(Some(Err(0)))); /// ``` #[stable(feature = "poll_map", since = "1.51.0")] + #[inline] pub fn map_err(self, f: F) -> Poll>> where F: FnOnce(E) -> U,