Skip to content

Commit

Permalink
refactor(cli): use tokio::fs for reading file content
Browse files Browse the repository at this point in the history
  • Loading branch information
hougesen committed Dec 27, 2023
1 parent a30687c commit b514afd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hitt-cli/src/fs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ use hitt_parser::HittRequest;
use crate::error::HittCliError;

async fn get_file_content(path: &std::path::Path) -> Result<String, std::io::Error> {
std::fs::read(path).map(|buf| String::from_utf8_lossy(&buf).to_string())
tokio::fs::read(path)
.await
.map(|buf| String::from_utf8_lossy(&buf).to_string())
}

pub async fn parse_requests_threaded(
Expand Down

0 comments on commit b514afd

Please sign in to comment.