update code

This commit is contained in:
lychang
2024-01-12 04:31:47 +08:00
parent e9b4754819
commit a6a8082e93

View File

@@ -17,13 +17,6 @@ pub(crate) fn write_file(path: &str, content: Bytes) -> Result<(), std::io::Erro
Ok(())
}
pub(crate) fn read_file(path: &str) -> Result<Bytes, std::io::Error> {
let mut file = File::open(path)?;
let mut contents = Vec::new();
file.read_to_end(&mut contents)?;
Ok(Bytes::from(contents))
}
pub(crate) fn read_file_string(path: &str) -> Result<String, std::io::Error> {
let mut file = File::open(path)?;
let mut contents = String::new();