confy 2.0.0

Boilerplate-free configuration management
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Some storage utilities

use std::fs::File;
use std::io::{Error as IoError, Read};

pub trait CheckedStringRead {
    fn get_string(&mut self) -> Result<String, IoError>;
}

impl CheckedStringRead for File {
    fn get_string(&mut self) -> Result<String, IoError> {
        let mut s = String::new();
        self.read_to_string(&mut s)?;
        Ok(s)
    }
}