diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-04-16 05:14:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-15 23:14:28 -0400 |
commit | aab26d226e32ac84da8c855388217b3ee781979d (patch) | |
tree | 118aef355e921f830ffbc6c6685f96138787b224 /cli/compilers | |
parent | fab0204cbf20cc1be7874266325bf258fe0ecaca (diff) |
remove calls to futures::executor::block_on (#4760)
Diffstat (limited to 'cli/compilers')
-rw-r--r-- | cli/compilers/ts.rs | 10 |
1 files changed, 4 insertions, 6 deletions
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<SourceFile> { 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 |