From 9bfb0df805719cb3f022a5b5d9f9d898ae954c2e Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Wed, 26 Aug 2020 00:22:15 +0200 Subject: refactor: remove OpError, use ErrBox everywhere (#7187) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartek IwaƄczuk --- cli/swc_util.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'cli/swc_util.rs') diff --git a/cli/swc_util.rs b/cli/swc_util.rs index 934bed01a..7c7d01832 100644 --- a/cli/swc_util.rs +++ b/cli/swc_util.rs @@ -236,8 +236,7 @@ impl AstParser { media_type: MediaType, source_code: &str, ) -> Result { - let parse_result = self.parse_module(file_name, media_type, source_code); - let module = parse_result?; + let module = self.parse_module(file_name, media_type, source_code)?; let program = Program::Module(module); let mut compiler_pass = chain!(typescript::strip(), fixer(Some(&self.comments))); @@ -261,7 +260,7 @@ impl AstParser { }; program.emit_with(&mut emitter)?; } - let mut src = String::from_utf8(buf).map_err(ErrBox::from)?; + let mut src = String::from_utf8(buf)?; { let mut buf = vec![]; self -- cgit v1.2.3