From ded68aba7302488c1e41214766017f9f5a9a2d86 Mon Sep 17 00:00:00 2001 From: Casper Beyer Date: Sun, 28 Feb 2021 23:28:02 +0800 Subject: [PATCH] chore(runtime): remove rustyline dependency (#9625) --- Cargo.lock | 1 - runtime/Cargo.toml | 1 - runtime/errors.rs | 17 ----------------- 3 files changed, 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2213669516..cb03ac66b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -554,7 +554,6 @@ dependencies = [ "percent-encoding", "regex", "ring", - "rustyline", "serde", "sys-info", "termcolor", diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 091e0340d7..cdae5a40cc 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -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" diff --git a/runtime/errors.rs b/runtime/errors.rs index 7c497ef32f..b3d4745043 100644 --- a/runtime/errors.rs +++ b/runtime/errors.rs @@ -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: ¬ify::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: ®ex::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::() .map(get_notify_error_class) }) - .or_else(|| { - e.downcast_ref::() - .map(get_readline_error_class) - }) .or_else(|| { e.downcast_ref::() .map(get_request_error_class)