From 7d35841502257221645929ae73abc69947f35b9d Mon Sep 17 00:00:00 2001 From: Marcus Ball Date: Wed, 28 Dec 2016 23:38:31 -0500 Subject: [PATCH] changed Windows transform code to an statement --- contrib/src/templates/mod.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/contrib/src/templates/mod.rs b/contrib/src/templates/mod.rs index ea954bd2..803e0cb2 100644 --- a/contrib/src/templates/mod.rs +++ b/contrib/src/templates/mod.rs @@ -191,13 +191,12 @@ fn split_path(path: &Path) -> (PathBuf, String, Option) { let rel_path = path.strip_prefix(&*TEMPLATE_DIR).unwrap().to_path_buf(); let path_no_ext = remove_extension(&rel_path); let data_type = path_no_ext.extension(); - let name = remove_extension(&path_no_ext).to_string_lossy().into_owned(); + let mut name = remove_extension(&path_no_ext).to_string_lossy().into_owned(); // Ensure template name consistency on Windows systems - let name = match cfg!(windows) { - true => name.replace("\\", "/"), - false => name, - }; + if cfg!(windows) { + name = name.replace("\\", "/"); + } (rel_path, name, data_type.map(|d| d.to_string_lossy().into_owned())) }