fork of https://github.com/rustwasm/wasm-pack for the needs of NextGraph.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
csmoe bd3b5177a9 Split utils into submods 7 years ago
..
manifest.rs Split utils into submods 7 years ago
mod.rs Split utils into submods 7 years ago
readme.rs Split utils into submods 7 years ago

readme.rs

use std::fs::File;
use std::io::Read;
use std::path::Path;

use failure::Error;

pub fn read_file(path: &Path) -> Result<String, Error> {
let mut file = File::open(path)?;
let mut contents = String::new();
file.read_to_string(&mut contents)?;

Ok(contents)
}