summaryrefslogtreecommitdiff
path: root/cli/swc_util.rs
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2020-08-26 00:22:15 +0200
committerGitHub <noreply@github.com>2020-08-26 00:22:15 +0200
commit9bfb0df805719cb3f022a5b5d9f9d898ae954c2e (patch)
tree6c7d62d95fcbde54ebbe1035bdc74618c63cfbc0 /cli/swc_util.rs
parentd0ccab7fb7dd80030d3765ca9a9af44de6ecda5a (diff)
refactor: remove OpError, use ErrBox everywhere (#7187)
Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/swc_util.rs')
-rw-r--r--cli/swc_util.rs5
1 files changed, 2 insertions, 3 deletions
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<String, ErrBox> {
- 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