mirror of https://github.com/stjepang/smol
Fix compilation errors on windows
This commit is contained in:
parent
f62230939a
commit
4a18f3cb37
|
@ -65,3 +65,6 @@ url = "2.1.1"
|
|||
inotify = { version = "0.8.2", default-features = false }
|
||||
nix = "0.17.0"
|
||||
timerfd = "1.1.1"
|
||||
|
||||
[target.'cfg(windows)'.dev-dependencies]
|
||||
uds_windows = "0.1.4"
|
||||
|
|
|
@ -10,9 +10,11 @@
|
|||
fn main() -> std::io::Result<()> {
|
||||
use std::path::PathBuf;
|
||||
|
||||
use async_io::Async;
|
||||
use blocking::block_on;
|
||||
use futures::io;
|
||||
use futures::prelude::*;
|
||||
use smol::{Async, Task};
|
||||
use smol::Task;
|
||||
use tempfile::tempdir;
|
||||
use uds_windows::{UnixListener, UnixStream};
|
||||
|
||||
|
@ -30,7 +32,7 @@ fn main() -> std::io::Result<()> {
|
|||
let dir = tempdir()?;
|
||||
let path = dir.path().join("socket");
|
||||
|
||||
smol::run(async {
|
||||
block_on(async {
|
||||
// Create a listener.
|
||||
let listener = Async::new(UnixListener::bind(&path)?)?;
|
||||
println!("Listening on {:?}", listener.get_ref().local_addr()?);
|
||||
|
|
|
@ -255,7 +255,6 @@ fn enter<T>(f: impl FnOnce() -> T) -> T {
|
|||
|
||||
#[cfg(feature = "tokio02")]
|
||||
{
|
||||
use once_cell::sync::Lazy;
|
||||
use std::cell::Cell;
|
||||
use tokio::runtime::Runtime;
|
||||
|
||||
|
|
Loading…
Reference in New Issue