summaryrefslogtreecommitdiff
path: root/src/fs.rs
diff options
context:
space:
mode:
authorAaron Power <theaaronepower@gmail.com>2018-08-26 10:51:25 +0100
committerRyan Dahl <ry@tinyclouds.org>2018-08-26 11:00:22 -0400
commit3a5cf9ca8b6a4dae204139faff3f3bbad1f78b54 (patch)
treeed25062a8d269718e2a971f432c8fcaa8f85bb36 /src/fs.rs
parent84c38f34eeb2a6f9f6786aba0f5da5eb9efa422b (diff)
Replaced read_file_sync{_string} with std::fs::read{_to_string}
Diffstat (limited to 'src/fs.rs')
-rw-r--r--src/fs.rs15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/fs.rs b/src/fs.rs
index 28f269f59..50c99c593 100644
--- a/src/fs.rs
+++ b/src/fs.rs
@@ -1,23 +1,8 @@
use std;
use std::fs::File;
-use std::io::Read;
use std::io::Write;
use std::path::Path;
-pub fn read_file_sync(path: &Path) -> std::io::Result<Vec<u8>> {
- File::open(path).and_then(|mut f| {
- let mut buffer = Vec::new();
- f.read_to_end(&mut buffer)?;
- Ok(buffer)
- })
-}
-
-pub fn read_file_sync_string(path: &Path) -> std::io::Result<String> {
- let vec = read_file_sync(path)?;
- String::from_utf8(vec)
- .map_err(|err| std::io::Error::new(std::io::ErrorKind::InvalidData, err))
-}
-
pub fn write_file_sync(path: &Path, content: &[u8]) -> std::io::Result<()> {
let mut f = File::create(path)?;
f.write_all(content)