Fix uv-fs extras by removing dead code (#2272)

Running the pep508_rs tests was failing due to uv-fs depending on
`fs_err::tokio` even when not selected. But the function that used it is
unused anyway, so i removed it.
This commit is contained in:
konsti 2024-03-07 13:16:29 +01:00 committed by GitHub
parent d798653750
commit 85042308a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 16 deletions

View file

@ -36,7 +36,7 @@ nanoid = { workspace = true }
reqwest = { workspace = true } reqwest = { workspace = true }
rmp-serde = { workspace = true } rmp-serde = { workspace = true }
rustc-hash = { workspace = true } rustc-hash = { workspace = true }
serde = { workspace = true , features = ["derive"] } serde = { workspace = true, features = ["derive"] }
tempfile = { workspace = true } tempfile = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
tokio = { workspace = true } tokio = { workspace = true }

View file

@ -13,20 +13,6 @@ pub use crate::path::*;
mod path; mod path;
/// Reads the contents of the file path into memory.
///
/// If the file path is `-`, then contents are read from stdin instead.
pub async fn read(path: impl AsRef<Path>) -> std::io::Result<Vec<u8>> {
let path = path.as_ref();
if path == Path::new("-") {
let mut buf = Vec::with_capacity(1024);
std::io::stdin().read_to_end(&mut buf)?;
Ok(buf)
} else {
fs_err::tokio::read(path).await
}
}
/// Reads the contents of the file path into memory as a `String`. /// Reads the contents of the file path into memory as a `String`.
/// ///
/// If the file path is `-`, then contents are read from stdin instead. /// If the file path is `-`, then contents are read from stdin instead.