pub fn persist(&self) -> Result<()> {
        use std::io::Write;

        self.path.parent().map_or(
            Err(io::Error::new(
                io::ErrorKind::InvalidInput,
                "Invalid configuration path",
            )),
            fs::create_dir_all,
        )?;
        let data = serialize(&self.current)?;
        let mut file = fs::File::create(self.path.as_path())?;
        file.write_all(data.as_slice())?;
        file.flush()?;
        Ok(())
    }
/// Persist this instance's current configuration values to disk, so they
/// can be re-loaded on the next construction.
Persist this instance's current configuration values to disk, so they
can be re-loaded on the next construction.
Persist this instance ' s current configuration values to disk so they can be re - loaded on the next construction .
pub fn persist(&self) -> Result<()> {
        use std::io::Write;
        self.path.parent().map_or(
            Err(io::Error::new(
                io::ErrorKind::InvalidInput,
                "Invalid configuration path",
            )),
            fs::create_dir_all,
        )?;
        let data = serialize(&self.current)?;
        let mut file = fs::File::create(self.path.as_path())?;
        file.write_all(data.as_slice())?;
        file.flush()?;
        Ok(())
    }
pub fn persist ( & self ) -> Result < ( ) > { use std :: io :: Write ; self . path . parent ( ) . map_or ( Err ( io :: Error :: new ( io :: ErrorKind :: InvalidInput , " " , ) ) , fs :: create_dir_all , ) ? ; let data = serialize ( & self . current ) ? ; let mut file = fs :: File :: create ( self . path . as_path ( ) ) ? ; file . write_all ( data . as_slice ( ) ) ? ; file . flush ( ) ? ; Ok ( ( ) ) }
Persist this instance's current configuration values to disk, so they
can be re-loaded on the next construction.
Persist this instance ' s current configuration values to disk so they can be re - loaded on the next construction .
&self
&self