From 3b3a34b0fa00afd48763ce52a06e311a7a584694 Mon Sep 17 00:00:00 2001 From: Li Junchen Date: Thu, 25 Jul 2024 16:58:58 +0800 Subject: [PATCH] chore: remove useless Option (#65) --- crates/moon/src/cli/run.rs | 2 +- crates/moonbuild/src/entry.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/moon/src/cli/run.rs b/crates/moon/src/cli/run.rs index 79376626..9a22fbba 100644 --- a/crates/moon/src/cli/run.rs +++ b/crates/moon/src/cli/run.rs @@ -249,7 +249,7 @@ pub fn run_run_internal(cli: &UniversalFlags, cmd: RunSubcommand) -> anyhow::Res trace::open("trace.json").context("failed to open `trace.json`")?; } - let result = entry::run_run(Some(&package_path), &moonc_opt, &moonbuild_opt, &module); + let result = entry::run_run(&package_path, &moonc_opt, &moonbuild_opt, &module); if trace_flag { trace::close(); } diff --git a/crates/moonbuild/src/entry.rs b/crates/moonbuild/src/entry.rs index ab686723..0d26dd87 100644 --- a/crates/moonbuild/src/entry.rs +++ b/crates/moonbuild/src/entry.rs @@ -189,7 +189,7 @@ pub fn run_build( } pub fn run_run( - package_path: Option<&String>, + package_path: &str, moonc_opt: &MooncOpt, moonbuild_opt: &MoonbuildOpt, module: &ModuleDB, @@ -197,7 +197,6 @@ pub fn run_run( run_build(moonc_opt, moonbuild_opt, module)?; let (source_dir, target_dir) = (&moonbuild_opt.source_dir, &moonbuild_opt.target_dir); let package_path = package_path - .unwrap() .trim_start_matches("./") .trim_start_matches(".\\") .trim_end_matches(is_slash);