systemstat 0.2.6

Get system information/statistics in a cross-platform way
Documentation
1
2
3
4
5
6
7
8
9
use std::io::Read;
use std::{fs, io, str};

pub fn read_file(path: &str) -> io::Result<String> {
    let mut s = String::new();
    fs::File::open(path)
        .and_then(|mut f| f.read_to_string(&mut s))
        .map(|_| s)
}