diff --git a/src/bin/concat_chapters.rs b/src/bin/concat_chapters.rs index 5ed8266b8..8afb566ee 100644 --- a/src/bin/concat_chapters.rs +++ b/src/bin/concat_chapters.rs @@ -11,13 +11,11 @@ use std::collections::BTreeMap; use regex::Regex; - static PATTERNS: &'static [(&'static str, &'static str)] = &[ (r"ch(\d\d)-\d\d-.*\.md", "chapter$1.md"), (r"appendix-(\d\d).*\.md", "appendix.md"), ]; - lazy_static! { static ref MATCHERS: Vec<(Regex, &'static str)> = { PATTERNS.iter() @@ -26,7 +24,6 @@ lazy_static! { }; } - fn main() { let args: Vec = env::args().collect(); @@ -46,8 +43,6 @@ fn main() { } } - - fn match_files(source_dir: &Path, target_dir: &Path) -> Vec<(PathBuf, PathBuf)> { read_dir(source_dir) .expect("Unable to read source directory") @@ -69,7 +64,6 @@ fn match_files(source_dir: &Path, target_dir: &Path) -> Vec<(PathBuf, PathBuf)> .collect() } - fn group_by_target(matched_files: Vec<(PathBuf, PathBuf)>) -> BTreeMap> { let mut grouped: BTreeMap> = BTreeMap::new(); for (source, target) in matched_files { @@ -83,7 +77,6 @@ fn group_by_target(matched_files: Vec<(PathBuf, PathBuf)>) -> BTreeMap, target_path: PathBuf) -> io::Result<()> { println!("Concatenating into {}:", target_path.to_string_lossy()); let mut target = try!(File::create(target_path)); @@ -104,7 +97,6 @@ fn concat_files(source_paths: Vec, target_path: PathBuf) -> io::Result< Ok(()) } - fn ensure_dir_exists(dir_string: &str) -> io::Result<&Path> { let path = Path::new(dir_string); if !path.exists() {