mirror of
https://github.com/denoland/deno.git
synced 2025-01-03 04:48:52 -05:00
parent
1698bc64c1
commit
f858b653be
1 changed files with 2 additions and 33 deletions
|
@ -1,5 +1,6 @@
|
||||||
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
use deno_core::error::AnyError;
|
||||||
use deno_core::serde_json::{self, Value};
|
use deno_core::serde_json::{self, Value};
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use std::time::SystemTime;
|
use std::time::SystemTime;
|
||||||
|
@ -491,36 +492,4 @@ fn main() -> Result<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
pub(crate) type Result<T> = std::result::Result<T, AnyError>;
|
||||||
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>;
|
|
||||||
|
|
Loading…
Reference in a new issue