2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-01-16 10:49:55 +00:00

update to work on smol/master

This commit is contained in:
dignifiedquire 2020-04-25 19:05:05 +02:00
parent 10c8b9a6d8
commit 0a7a52aed5
3 changed files with 4 additions and 3 deletions

View file

@ -319,7 +319,8 @@ impl AsRawFd for UnixDatagram {
impl FromRawFd for UnixDatagram {
unsafe fn from_raw_fd(fd: RawFd) -> UnixDatagram {
let datagram = Async::<StdUnixDatagram>::from_raw_fd(fd);
let raw = StdUnixDatagram::from_raw_fd(fd);
let datagram = Async::<StdUnixDatagram>::new(raw).expect("invalid file descriptor");
UnixDatagram { watcher: datagram }
}
}

View file

@ -55,7 +55,7 @@ impl Builder {
let wrapped = self.build(future);
let task = wrapped.tag.task().clone();
let smol_task = smol::Task::spawn(wrapped).detach();
let smol_task = smol::Task::spawn(wrapped).into();
Ok(JoinHandle::new(smol_task, task))
}

View file

@ -37,6 +37,6 @@ where
{
once_cell::sync::Lazy::force(&crate::rt::RUNTIME);
let handle = smol::Task::blocking(async move { f() }).detach();
let handle = smol::Task::blocking(async move { f() }).into();
JoinHandle::new(handle, Task::new(None))
}