1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 15:49:44 -05:00

chore(runtime): remove rustyline dependency (#9625)

This commit is contained in:
Casper Beyer 2021-02-28 23:28:02 +08:00 committed by GitHub
parent d88d8b75d0
commit ded68aba73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 19 deletions

1
Cargo.lock generated
View file

@ -554,7 +554,6 @@ dependencies = [
"percent-encoding",
"regex",
"ring",
"rustyline",
"serde",
"sys-info",
"termcolor",

View file

@ -49,7 +49,6 @@ notify = "5.0.0-pre.4"
percent-encoding = "2.1.0"
regex = "1.4.3"
ring = "0.16.20"
rustyline = { version = "7.1.0", default-features = false }
serde = { version = "1.0.123", features = ["derive"] }
sys-info = "0.8.0"
termcolor = "1.1.2"

View file

@ -14,7 +14,6 @@ use deno_core::serde_json;
use deno_core::url;
use deno_core::ModuleResolutionError;
use deno_fetch::reqwest;
use rustyline::error::ReadlineError;
use std::env;
use std::error::Error;
use std::io;
@ -82,18 +81,6 @@ fn get_notify_error_class(error: &notify::Error) -> &'static str {
}
}
fn get_readline_error_class(error: &ReadlineError) -> &'static str {
use ReadlineError::*;
match error {
Io(err) => get_io_error_class(err),
Eof => "UnexpectedEof",
Interrupted => "Interrupted",
#[cfg(unix)]
Errno(err) => get_nix_error_class(err),
_ => unimplemented!(),
}
}
fn get_regex_error_class(error: &regex::Error) -> &'static str {
use regex::Error::*;
match error {
@ -187,10 +174,6 @@ pub fn get_error_class_name(e: &AnyError) -> Option<&'static str> {
e.downcast_ref::<notify::Error>()
.map(get_notify_error_class)
})
.or_else(|| {
e.downcast_ref::<ReadlineError>()
.map(get_readline_error_class)
})
.or_else(|| {
e.downcast_ref::<reqwest::Error>()
.map(get_request_error_class)