mirror of https://github.com/astral-sh/uv
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:
parent
d798653750
commit
85042308a1
|
|
@ -36,7 +36,7 @@ nanoid = { workspace = true }
|
|||
reqwest = { workspace = true }
|
||||
rmp-serde = { workspace = true }
|
||||
rustc-hash = { workspace = true }
|
||||
serde = { workspace = true , features = ["derive"] }
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
tempfile = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
|
|
|
|||
|
|
@ -13,20 +13,6 @@ pub use crate::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`.
|
||||
///
|
||||
/// If the file path is `-`, then contents are read from stdin instead.
|
||||
|
|
|
|||
Loading…
Reference in New Issue