diff options
author | Muhammad Mominul Huque <[email protected]> | 2018-10-16 10:36:53 +0100 |
---|---|---|
committer | Muhammad Mominul Huque <[email protected]> | 2018-10-16 10:36:53 +0100 |
commit | 2c4cfb297ec59625310023796b65e3dd48f1e76a (patch) | |
tree | e6d6e34aba7d37f6d3c0e1056838e073aa185881 /crates/tools/src | |
parent | 9d9e637ef39cbc00eaebad93294a60ccfd3405eb (diff) |
take `&Path` instead of `PathBuf`
Diffstat (limited to 'crates/tools/src')
-rw-r--r-- | crates/tools/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/tools/src/main.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs index 548b157dd..9a1b12a16 100644 --- a/crates/tools/src/lib.rs +++ b/crates/tools/src/lib.rs | |||
@@ -77,7 +77,7 @@ pub fn update(path: &Path, contents: &str, verify: bool) -> Result<()> { | |||
77 | Ok(()) | 77 | Ok(()) |
78 | } | 78 | } |
79 | 79 | ||
80 | pub fn render_template(template: PathBuf) -> Result<String> { | 80 | pub fn render_template(template: &Path) -> Result<String> { |
81 | let grammar: ron::value::Value = { | 81 | let grammar: ron::value::Value = { |
82 | let text = fs::read_to_string(project_root().join(GRAMMAR))?; | 82 | let text = fs::read_to_string(project_root().join(GRAMMAR))?; |
83 | ron::de::from_str(&text)? | 83 | ron::de::from_str(&text)? |
diff --git a/crates/tools/src/main.rs b/crates/tools/src/main.rs index 549892bc6..6eacfc190 100644 --- a/crates/tools/src/main.rs +++ b/crates/tools/src/main.rs | |||
@@ -40,8 +40,8 @@ fn main() -> Result<()> { | |||
40 | fn run_gen_command(name: &str, verify: bool) -> Result<()> { | 40 | fn run_gen_command(name: &str, verify: bool) -> Result<()> { |
41 | match name { | 41 | match name { |
42 | "gen-kinds" => { | 42 | "gen-kinds" => { |
43 | update(&project_root().join(SYNTAX_KINDS), &render_template(project_root().join(SYNTAX_KINDS_TEMPLATE))?, verify)?; | 43 | update(&project_root().join(SYNTAX_KINDS), &render_template(&project_root().join(SYNTAX_KINDS_TEMPLATE))?, verify)?; |
44 | update(&project_root().join(AST), &render_template(project_root().join(AST_TEMPLATE))?, verify)?; | 44 | update(&project_root().join(AST), &render_template(&project_root().join(AST_TEMPLATE))?, verify)?; |
45 | }, | 45 | }, |
46 | "gen-tests" => { | 46 | "gen-tests" => { |
47 | gen_tests(verify)? | 47 | gen_tests(verify)? |