diff --git a/cli/bench/main.rs b/cli/bench/main.rs index d3f00ee2c5..4f64659250 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 for Error { - fn from(ioe: std::io::Error) -> Self { - Error::Io(ioe) - } -} - -impl From for Error { - fn from(sje: serde_json::error::Error) -> Self { - Error::Serde(sje) - } -} - -impl From for Error { - fn from(fue: std::string::FromUtf8Error) -> Self { - Error::FromUtf8(fue) - } -} - -impl From for Error { - fn from(wde: walkdir::Error) -> Self { - Error::Walkdir(wde) - } -} - -pub(crate) type Result = std::result::Result; +pub(crate) type Result = std::result::Result;