zola/src/utils.rs

13 lines
260 B
Rust
Raw Normal View History

2016-12-13 06:22:24 +00:00
use std::io::prelude::*;
use std::fs::{File};
use std::path::Path;
use errors::Result;
pub fn create_file<P: AsRef<Path>>(path: P, content: &str) -> Result<()> {
let mut file = File::create(&path)?;
file.write_all(content.as_bytes())?;
Ok(())
}