mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
Fix uv tokio extra, part 2 (#2274)
Follow to #2272 by adding the tokio gate to `read_to_string`.
This commit is contained in:
parent
953a13f12e
commit
de0109169d
1 changed files with 3 additions and 1 deletions
|
@ -1,5 +1,4 @@
|
|||
use std::fmt::Display;
|
||||
use std::io::Read;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use fs2::FileExt;
|
||||
|
@ -16,7 +15,10 @@ mod path;
|
|||
/// Reads the contents of the file path into memory as a `String`.
|
||||
///
|
||||
/// If the file path is `-`, then contents are read from stdin instead.
|
||||
#[cfg(feature = "tokio")]
|
||||
pub async fn read_to_string(path: impl AsRef<Path>) -> std::io::Result<String> {
|
||||
use std::io::Read;
|
||||
|
||||
let path = path.as_ref();
|
||||
if path == Path::new("-") {
|
||||
let mut buf = String::with_capacity(1024);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue