pub fn store_to_file(path: &Path, ip: IpAddr) -> Result<(), String> {
        let mut file = match File::create(path) {
            Ok(file) => file,
            Err(err) => return Err(format!("Failed to open {}: {}", path.display(), err)),
        };

        match writeln!(file, "{}", ip) {
            Ok(_) => Ok(()),
            Err(err) => Err(format!("Failed to write to {}: {}", path.display(), err)),
        }
    }
/// Store Irro's IP to a file for later user. See `from_file()`.
///
/// # Errors
///
/// An error is returned if file couldn't be successfully written to.
Store Irro's IP to a file for later user.
Store Irro ' s IP to a file for later user .
pub fn store_to_file(path: &Path, ip: IpAddr) -> Result<(), String> {
        let mut file = match File::create(path) {
            Ok(file) => file,
            Err(err) => return Err(format!("Failed to open {}: {}", path.display(), err)),
        };
        match writeln!(file, "{}", ip) {
            Ok(_) => Ok(()),
            Err(err) => Err(format!("Failed to write to {}: {}", path.display(), err)),
        }
    }
pub fn store_to_file ( path : & Path , ip : IpAddr ) -> Result < ( ) , String > { let mut file = match File :: create ( path ) { Ok ( file ) => file , Err ( err ) => return Err ( format ! ( " " path display ( ) err ) ) , } ; match writeln ! ( file " " ip ) { Ok ( _ ) => Ok ( ( ) ) , Err ( err ) => Err ( format ! ( " " path display ( ) err ) ) , } }
Store Irro's IP to a file for later user.
Store Irro ' s IP to a file for later user .
path
&Path
ip
IpAddr
path
&Path
ip
IpAddr
errors
An error is returned if file couldn't be successfully written to.
An error is returned if file couldn ' t be successfully written to .