From 7bd18b4b22f3a6bf86b131329345f9a75d8f699c Mon Sep 17 00:00:00 2001 From: Malfurious Date: Sat, 28 Aug 2021 09:45:57 -0400 Subject: Commit Rust POC This replaces the Python script. Since all MIT-licensed code is removed, the LICENSE file is as well. 'cargo run' to run the program. Signed-off-by: Malfurious --- src/load_file.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/load_file.rs (limited to 'src/load_file.rs') diff --git a/src/load_file.rs b/src/load_file.rs new file mode 100644 index 0000000..0fd1541 --- /dev/null +++ b/src/load_file.rs @@ -0,0 +1,12 @@ +use std::fs::File; +use std::io::Read; + +pub fn load_file_vec(path: &String) -> std::io::Result> +{ + let mut file = File::open(path)?; + let mut data = Vec::new(); + + file.read_to_end(&mut data)?; + + Ok(data) +} -- cgit v1.2.3