/// Read the shared secret from a file.
Read the shared secret from a file.
Read the shared secret from a file .
pub fn read_shared_secret(path: &Path) -> Result<Vec<u8>, Error> {
    if !path.exists() {
        return Err(Error::FileNotFound(
            "Secret. Did you start the daemon at least once?".into(),
        ));
    }
    let mut file = File::open(path)?;
    let mut buffer = Vec::new();
    file.read_to_end(&mut buffer)?;
    Ok(buffer)
}
pub fn read_shared_secret ( path : & Path ) -> Result < Vec < u8 > , Error > { if ! path . exists ( ) { return Err ( Error :: FileNotFound ( " " . into ( ) , ) ) ; } let mut file = File :: open ( path ) ? ; let mut buffer = Vec :: new ( ) ; file . read_to_end ( & mut buffer ) ? ; Ok ( buffer ) }
Read the shared secret from a file.
Read the shared secret from a file .
path
&Path