diff options
Diffstat (limited to 'crates/tools/src')
-rw-r--r-- | crates/tools/src/main.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/tools/src/main.rs b/crates/tools/src/main.rs index d7f34d757..5bfaf18f1 100644 --- a/crates/tools/src/main.rs +++ b/crates/tools/src/main.rs | |||
@@ -10,7 +10,7 @@ extern crate commandspec; | |||
10 | extern crate heck; | 10 | extern crate heck; |
11 | 11 | ||
12 | use clap::{App, Arg, SubCommand}; | 12 | use clap::{App, Arg, SubCommand}; |
13 | use heck::{CamelCase, ShoutySnakeCase}; | 13 | use heck::{CamelCase, ShoutySnakeCase, SnakeCase}; |
14 | use std::{ | 14 | use std::{ |
15 | collections::HashMap, | 15 | collections::HashMap, |
16 | fs, | 16 | fs, |
@@ -91,6 +91,9 @@ fn render_template(template: &str) -> Result<String> { | |||
91 | tera.register_filter("camel", |arg, _| { | 91 | tera.register_filter("camel", |arg, _| { |
92 | Ok(arg.as_str().unwrap().to_camel_case().into()) | 92 | Ok(arg.as_str().unwrap().to_camel_case().into()) |
93 | }); | 93 | }); |
94 | tera.register_filter("snake", |arg, _| { | ||
95 | Ok(arg.as_str().unwrap().to_snake_case().into()) | ||
96 | }); | ||
94 | tera.register_filter("SCREAM", |arg, _| { | 97 | tera.register_filter("SCREAM", |arg, _| { |
95 | Ok(arg.as_str().unwrap().to_shouty_snake_case().into()) | 98 | Ok(arg.as_str().unwrap().to_shouty_snake_case().into()) |
96 | }); | 99 | }); |