From 2c4cfb297ec59625310023796b65e3dd48f1e76a Mon Sep 17 00:00:00 2001 From: Muhammad Mominul Huque Date: Tue, 16 Oct 2018 15:36:53 +0600 Subject: take `&Path` instead of `PathBuf` --- crates/tools/src/lib.rs | 2 +- crates/tools/src/main.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/tools/src') 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<()> { Ok(()) } -pub fn render_template(template: PathBuf) -> Result { +pub fn render_template(template: &Path) -> Result { let grammar: ron::value::Value = { let text = fs::read_to_string(project_root().join(GRAMMAR))?; 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<()> { fn run_gen_command(name: &str, verify: bool) -> Result<()> { match name { "gen-kinds" => { - update(&project_root().join(SYNTAX_KINDS), &render_template(project_root().join(SYNTAX_KINDS_TEMPLATE))?, verify)?; - update(&project_root().join(AST), &render_template(project_root().join(AST_TEMPLATE))?, verify)?; + update(&project_root().join(SYNTAX_KINDS), &render_template(&project_root().join(SYNTAX_KINDS_TEMPLATE))?, verify)?; + update(&project_root().join(AST), &render_template(&project_root().join(AST_TEMPLATE))?, verify)?; }, "gen-tests" => { gen_tests(verify)? -- cgit v1.2.3