summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Perron <hey@wperron.io>2021-01-27 19:50:14 -0800
committerGitHub <noreply@github.com>2021-01-27 22:50:14 -0500
commitf858b653be7529ed7ae4dceff6af640a6d4c3722 (patch)
treec8608c418d1932ede04841044be19141da0bae75
parent1698bc64c13366cd6248d99f089877d5111731b9 (diff)
bench: remove custom error types (#9301)
Fixes #9253
-rw-r--r--cli/bench/main.rs35
1 files changed, 2 insertions, 33 deletions
diff --git a/cli/bench/main.rs b/cli/bench/main.rs
index d3f00ee2c..4f6465925 100644
--- a/cli/bench/main.rs
+++ b/cli/bench/main.rs
@@ -1,5 +1,6 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+use deno_core::error::AnyError;
use deno_core::serde_json::{self, Value};
use serde::Serialize;
use std::time::SystemTime;
@@ -491,36 +492,4 @@ fn main() -> Result<()> {
Ok(())
}
-#[derive(Debug)]
-enum Error {
- Io(std::io::Error),
- Serde(serde_json::error::Error),
- FromUtf8(std::string::FromUtf8Error),
- Walkdir(walkdir::Error),
-}
-
-impl From<std::io::Error> for Error {
- fn from(ioe: std::io::Error) -> Self {
- Error::Io(ioe)
- }
-}
-
-impl From<serde_json::error::Error> for Error {
- fn from(sje: serde_json::error::Error) -> Self {
- Error::Serde(sje)
- }
-}
-
-impl From<std::string::FromUtf8Error> for Error {
- fn from(fue: std::string::FromUtf8Error) -> Self {
- Error::FromUtf8(fue)
- }
-}
-
-impl From<walkdir::Error> for Error {
- fn from(wde: walkdir::Error) -> Self {
- Error::Walkdir(wde)
- }
-}
-
-pub(crate) type Result<T> = std::result::Result<T, Error>;
+pub(crate) type Result<T> = std::result::Result<T, AnyError>;