From aab26d226e32ac84da8c855388217b3ee781979d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 16 Apr 2020 05:14:28 +0200 Subject: remove calls to futures::executor::block_on (#4760) --- cli/compilers/ts.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'cli/compilers/ts.rs') diff --git a/cli/compilers/ts.rs b/cli/compilers/ts.rs index c78d7ef57..0e3e5c26c 100644 --- a/cli/compilers/ts.rs +++ b/cli/compilers/ts.rs @@ -455,7 +455,7 @@ impl TsCompiler { /// /// Along compiled file a special metadata file is saved as well containing /// hash that can be validated to avoid unnecessary recompilation. - async fn cache_compiled_file( + fn cache_compiled_file( &self, module_specifier: &ModuleSpecifier, contents: &str, @@ -468,7 +468,6 @@ impl TsCompiler { let source_file = self .file_fetcher .fetch_cached_source_file(&module_specifier) - .await .expect("Source file not found"); let version_hash = source_code_version_hash( @@ -528,7 +527,7 @@ impl TsCompiler { } /// This method is called by TS compiler via an "op". - pub async fn cache_compiler_output( + pub fn cache_compiler_output( &self, module_specifier: &ModuleSpecifier, extension: &str, @@ -536,7 +535,7 @@ impl TsCompiler { ) -> std::io::Result<()> { match extension { ".map" => self.cache_source_map(module_specifier, contents), - ".js" => self.cache_compiled_file(module_specifier, contents).await, + ".js" => self.cache_compiled_file(module_specifier, contents), _ => unreachable!(), } } @@ -578,10 +577,9 @@ impl TsCompiler { script_name: &str, ) -> Option { if let Some(module_specifier) = self.try_to_resolve(script_name) { - let fut = self + return self .file_fetcher .fetch_cached_source_file(&module_specifier); - return futures::executor::block_on(fut); } None -- cgit v1.2.3