forked from mirror/async-std
update to work on smol/master
This commit is contained in:
parent
10c8b9a6d8
commit
0a7a52aed5
3 changed files with 4 additions and 3 deletions
|
@ -319,7 +319,8 @@ impl AsRawFd for UnixDatagram {
|
||||||
|
|
||||||
impl FromRawFd for UnixDatagram {
|
impl FromRawFd for UnixDatagram {
|
||||||
unsafe fn from_raw_fd(fd: RawFd) -> 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 }
|
UnixDatagram { watcher: datagram }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ impl Builder {
|
||||||
let wrapped = self.build(future);
|
let wrapped = self.build(future);
|
||||||
|
|
||||||
let task = wrapped.tag.task().clone();
|
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))
|
Ok(JoinHandle::new(smol_task, task))
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,6 @@ where
|
||||||
{
|
{
|
||||||
once_cell::sync::Lazy::force(&crate::rt::RUNTIME);
|
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))
|
JoinHandle::new(handle, Task::new(None))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue