pub fn from_path(pass_path: &Path) -> io::Result<Self> {
        let mut path_buf = pass_path.to_path_buf();
        path_buf.push("pass.json");

        let file = File::open(&path_buf).unwrap();
        let mut file_reader = BufReader::new(file);
        let mut file_buffer = Vec::new();
        file_reader.read_to_end(&mut file_buffer).unwrap();
        let template: crate::template::Template = serde_json::from_slice(&file_buffer)?;

        Ok(Self {
            pass_path: pass_path.to_path_buf(),
            template,
        })
    }
/// Parse a `Pass` instance from the given directory
Parse a `Pass` instance from the given directory
Parse a ` Pass ` instance from the given directory
pub fn from_path(pass_path: &Path) -> io::Result<Self> {
        let mut path_buf = pass_path.to_path_buf();
        path_buf.push("pass.json");
        let file = File::open(&path_buf).unwrap();
        let mut file_reader = BufReader::new(file);
        let mut file_buffer = Vec::new();
        file_reader.read_to_end(&mut file_buffer).unwrap();
        let template: crate::template::Template = serde_json::from_slice(&file_buffer)?;
        Ok(Self {
            pass_path: pass_path.to_path_buf(),
            template,
        })
    }
pub fn from_path ( pass_path : & Path ) -> io :: Result < Self > { let mut path_buf = pass_path . to_path_buf ( ) ; path_buf . push ( " " ) ; let file = File :: open ( & path_buf ) . unwrap ( ) ; let mut file_reader = BufReader :: new ( file ) ; let mut file_buffer = Vec :: new ( ) ; file_reader . read_to_end ( & mut file_buffer ) . unwrap ( ) ; let template : crate :: template :: Template = serde_json :: from_slice ( & file_buffer ) ? ; Ok ( Self { pass_path : pass_path . to_path_buf ( ) , template , } ) }
Parse a `Pass` instance from the given directory
Parse a ` Pass ` instance from the given directory
pass_path
&Path
pass_path
&Path