From 53c57b71adcaf3b6de1ca2a99946692db2984582 Mon Sep 17 00:00:00 2001 From: syn Date: Thu, 11 Mar 2021 23:25:32 +0300 Subject: remove templates this is kinda annoying and useless feature --- src/conf.rs | 6 ------ src/main.rs | 8 +------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/conf.rs b/src/conf.rs index 0a343bb..f8c7bdb 100644 --- a/src/conf.rs +++ b/src/conf.rs @@ -23,12 +23,6 @@ pub struct Conf { } impl Conf { - pub fn get_template(&self, fname: &Path) -> &str { - self.get_backend(fname) - .and_then(|backend| backend.get_template()) - .unwrap_or("") - } - pub fn get_backend(&self, fname: &Path) -> Option> { let ext = fname.extension().and_then(|ext| ext.to_str()).unwrap_or(""); diff --git a/src/main.rs b/src/main.rs index d1484a4..c85b30a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,6 @@ extern crate lazy_static; use clap::{App, AppSettings, Arg, SubCommand}; use env_logger; use log::error; -use std::io::prelude::*; mod backends; mod conf; @@ -78,11 +77,6 @@ fn main() { error!("could not match backend"); } } else { - let template = config.get_template(&src_path).as_bytes(); - if let Err(err) = - std::fs::File::create(&src_path).and_then(|mut file| file.write_all(template)) - { - error!("{}", err); - } + error!("File {} does not exist", src_path.display()); }; } -- cgit v1.2.1-18-gbd029