From dec31adde22cbbcad68cf5a7713837090697ed97 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Wed, 14 Apr 2021 13:45:01 -0300 Subject: [PATCH] fix(cli.rs): init issue --- tooling/cli.rs/src/init.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tooling/cli.rs/src/init.rs b/tooling/cli.rs/src/init.rs index 86fa63d71..973f3e261 100644 --- a/tooling/cli.rs/src/init.rs +++ b/tooling/cli.rs/src/init.rs @@ -160,8 +160,10 @@ fn render_template>( let mut file_path = file.path().to_path_buf(); // cargo for some reason ignores the /templates folder packaging when it has a Cargo.toml file inside // so we rename the extension to `.crate-manifest` - if file_path.extension().unwrap() == "crate-manifest" { - file_path.set_extension("toml"); + if let Some(extension) = file_path.extension() { + if extension == "crate-manifest" { + file_path.set_extension("toml"); + } } let mut output_file = File::create(out_dir.as_ref().join(file_path))?; if let Some(utf8) = file.contents_utf8() {