mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
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
2 changed files with 2 additions and 16 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue