Run Rustfmt

master
marisa 3 years ago
parent e87fa32275
commit 77f13cb3ff
  1. 1
      .rustfmt.toml
  2. 5
      shtola/src/frontmatter.rs
  3. 26
      shtola/src/lib.rs
  4. 6
      ware/src/lib.rs

@ -0,0 +1 @@
hard_tabs = true

@ -12,10 +12,7 @@ pub fn lexer(text: &str) -> (String, String) {
content_slice.trim().to_string(),
)
} else {
(
String::new(),
text.to_string(),
)
(String::new(), text.to_string())
}
}

@ -1,12 +1,13 @@
use ware::Ware;
use im::HashMap;
use walkdir::WalkDir;
use yaml_rust::Yaml;
use pathdiff::diff_paths;
use std::path::PathBuf;
use std::fs::{File, canonicalize};
use std::io::Read;
use std::default::Default;
use std::fs::{canonicalize, File};
use std::io::Read;
use std::path::PathBuf;
use walkdir::WalkDir;
pub use im::HashMap;
pub use ware::Ware;
pub use yaml_rust::Yaml;
mod frontmatter;
@ -18,8 +19,14 @@ pub struct Shtola {
impl Shtola {
pub fn new() -> Shtola {
let config: Config = Default::default();
let ir = IR { files: HashMap::new(), config };
Shtola { ware: Ware::new(), ir }
let ir = IR {
files: HashMap::new(),
config,
};
Shtola {
ware: Ware::new(),
ir,
}
}
pub fn ignores(&mut self, vec: &mut Vec<PathBuf>) {
@ -72,7 +79,6 @@ pub struct Config {
frontmatter: bool,
}
#[derive(Debug, Clone)]
pub struct ShFile {
frontmatter: Vec<Yaml>,

@ -120,8 +120,10 @@ impl<R, S> Ware2<R, S> {
/// Run the registered middleware functions with the given value to pass
/// through. Returns whatever the last registered middleware function
/// returns.
pub fn run (&self, arg1: R, arg2: S) -> (R, S) {
self.fns.iter().fold((arg1, arg2), |acc, func| func(acc.0, acc.1))
pub fn run(&self, arg1: R, arg2: S) -> (R, S) {
self.fns
.iter()
.fold((arg1, arg2), |acc, func| func(acc.0, acc.1))
}
}

Loading…
Cancel
Save