mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-06 00:00:10 +02:00
sync: remove rt-core from blocking_{send,recv} (#2825)
This commit is contained in:
@@ -184,8 +184,6 @@ impl<T> Receiver<T> {
|
|||||||
/// sync_code.join().unwrap()
|
/// sync_code.join().unwrap()
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(feature = "rt-core")]
|
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "rt-core")))]
|
|
||||||
pub fn blocking_recv(&mut self) -> Option<T> {
|
pub fn blocking_recv(&mut self) -> Option<T> {
|
||||||
let mut enter_handle = crate::runtime::enter::enter(false);
|
let mut enter_handle = crate::runtime::enter::enter(false);
|
||||||
enter_handle.block_on(self.recv()).unwrap()
|
enter_handle.block_on(self.recv()).unwrap()
|
||||||
@@ -456,8 +454,6 @@ impl<T> Sender<T> {
|
|||||||
/// sync_code.join().unwrap()
|
/// sync_code.join().unwrap()
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(feature = "rt-core")]
|
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "rt-core")))]
|
|
||||||
pub fn blocking_send(&mut self, value: T) -> Result<(), SendError<T>> {
|
pub fn blocking_send(&mut self, value: T) -> Result<(), SendError<T>> {
|
||||||
let mut enter_handle = crate::runtime::enter::enter(false);
|
let mut enter_handle = crate::runtime::enter::enter(false);
|
||||||
enter_handle.block_on(self.send(value)).unwrap()
|
enter_handle.block_on(self.send(value)).unwrap()
|
||||||
|
|||||||
Reference in New Issue
Block a user