Cargo format

This commit is contained in:
Adrian Heine 2019-09-12 22:59:32 +02:00
parent 9bab810b91
commit 8c0224e983
44 changed files with 1784 additions and 611 deletions

View file

@ -1,12 +1,12 @@
extern crate schematics;
extern crate tempdir;
use schematics::symbols::file::File as FileSymbol;
use schematics::symbols::Symbol;
use std::fs::File;
use std::io::Write;
use std::path::Path;
use tempdir::TempDir;
use schematics::symbols::Symbol;
use schematics::symbols::file::File as FileSymbol;
fn get_dir(content: Option<&str>) -> TempDir {
let tmp_dir = TempDir::new("unittest").expect("create temp dir");
@ -15,12 +15,17 @@ fn get_dir(content: Option<&str>) -> TempDir {
}
let file_path = tmp_dir.path().join("filename");
let mut tmp_file = File::create(file_path).expect("create temp file");
tmp_file.write_all(content.unwrap().as_bytes()).expect("write temp file");
tmp_file
.write_all(content.unwrap().as_bytes())
.expect("write temp file");
tmp_dir
}
fn get_symbol(path: &Path) -> FileSymbol<&str, String> {
FileSymbol::new(String::from(path.join("filename").to_str().unwrap()), "target content")
FileSymbol::new(
String::from(path.join("filename").to_str().unwrap()),
"target content",
)
}
// Normal cases