From a64d2f7b018133b6e36d98a12dc3204d78ded361 Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Sat, 31 Oct 2020 12:43:03 +0100 Subject: [PATCH] pathbuf for input --- src/inputs/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/inputs/mod.rs b/src/inputs/mod.rs index c8854a4d60..af7d21d854 100644 --- a/src/inputs/mod.rs +++ b/src/inputs/mod.rs @@ -4,17 +4,18 @@ pub use bytes::BytesInput; use std::fs::File; use std::io::Read; use std::io::Write; +use std::path::PathBuf; use crate::AflError; pub trait Input { - fn to_file(&self, path: &str) -> Result<(), AflError> { + fn to_file(&self, path: &PathBuf) -> Result<(), AflError> { let mut file = File::create(path)?; file.write_all(self.serialize()?)?; Ok(()) } - fn from_file(&mut self, path: &str) -> Result<(), AflError> { + fn from_file(&mut self, path: &PathBuf) -> Result<(), AflError> { let mut file = File::create(path)?; let mut buf = vec![]; file.read_to_end(&mut buf)?;