summaryrefslogtreecommitdiff
path: root/cli/tools/compile.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-06-07 10:09:10 -0400
committerGitHub <noreply@github.com>2023-06-07 10:09:10 -0400
commitda9db887e34f0075e1433ee93854267aec0ef468 (patch)
treecb10d061c4d28933524a26d62d7ca4957d95a443 /cli/tools/compile.rs
parent28ce0ef583b1be03f5ec4fdd90b946590862c5d4 (diff)
refactor: helpers methods on `TypeCheckMode` (#19393)
Diffstat (limited to 'cli/tools/compile.rs')
-rw-r--r--cli/tools/compile.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/cli/tools/compile.rs b/cli/tools/compile.rs
index 540c23fc8..c53ae4e02 100644
--- a/cli/tools/compile.rs
+++ b/cli/tools/compile.rs
@@ -2,7 +2,6 @@
use crate::args::CompileFlags;
use crate::args::Flags;
-use crate::args::TypeCheckMode;
use crate::factory::CliFactory;
use crate::standalone::is_standalone_binary;
use crate::util::path::path_has_trailing_slash;
@@ -50,15 +49,15 @@ pub async fn compile(
.await?,
)
.unwrap();
- let graph = if cli_options.type_check_mode() == TypeCheckMode::None {
- graph
- } else {
+ let graph = if cli_options.type_check_mode().is_true() {
// In this case, the previous graph creation did type checking, which will
// create a module graph with types information in it. We don't want to
// store that in the eszip so create a code only module graph from scratch.
module_graph_builder
.create_graph(GraphKind::CodeOnly, module_roots)
.await?
+ } else {
+ graph
};
let parser = parsed_source_cache.as_capturing_parser();