diff --git a/src/lib.rs b/src/lib.rs index c41d915..4ddda57 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,6 @@ #![cfg_attr(feature = "std", doc = include_str!("../README.md"))] #![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(all(target_os = "wasi", target_env = "p2"), feature(wasip2))] #[doc = include_str!("../README.md")] #[cfg(all(doctest, feature = "std"))] diff --git a/src/typed/non_utf8/pathbuf.rs b/src/typed/non_utf8/pathbuf.rs index 72a1682..9fad919 100644 --- a/src/typed/non_utf8/pathbuf.rs +++ b/src/typed/non_utf8/pathbuf.rs @@ -1,8 +1,10 @@ use alloc::borrow::Cow; use alloc::collections::TryReserveError; use core::convert::TryFrom; +#[cfg(all(feature = "std", not(target_family = "wasm")))] +use std::io; #[cfg(feature = "std")] -use std::{io, path::PathBuf}; +use std::path::PathBuf; use crate::common::{CheckedPathError, StripPrefixError}; use crate::no_std_compat::*;