Browse Source

Upgraded rustyline & phf (#2193)

This Pull Request overrides #2183 #2187, #2189 and #2190.

It changes the following:

- Updates rustyline to 10.0.0 (this uses the new phf 0.11)
- Updates phf to 0.11 to avoid different dependency versions
- Fixes the `Editor` creation, which now returns a `Result`.
pull/2194/head
Iban Eguia 2 years ago
parent
commit
79ea834f92
  1. 35
      Cargo.lock
  2. 4
      boa_cli/Cargo.toml
  3. 5
      boa_cli/src/main.rs

35
Cargo.lock generated

@ -949,15 +949,13 @@ dependencies = [
[[package]] [[package]]
name = "nix" name = "nix"
version = "0.23.1" version = "0.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6" checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"cc",
"cfg-if", "cfg-if",
"libc", "libc",
"memoffset",
] ]
[[package]] [[package]]
@ -1071,20 +1069,19 @@ dependencies = [
[[package]] [[package]]
name = "phf" name = "phf"
version = "0.10.1" version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" checksum = "4724fa946c8d1e7cd881bd3dbee63ce32fc1e9e191e35786b3dc1320a3f68131"
dependencies = [ dependencies = [
"phf_macros", "phf_macros",
"phf_shared", "phf_shared",
"proc-macro-hack",
] ]
[[package]] [[package]]
name = "phf_generator" name = "phf_generator"
version = "0.10.0" version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" checksum = "5b450720b6f75cfbfabc195814bd3765f337a4f9a83186f8537297cac12f6705"
dependencies = [ dependencies = [
"phf_shared", "phf_shared",
"rand", "rand",
@ -1092,13 +1089,12 @@ dependencies = [
[[package]] [[package]]
name = "phf_macros" name = "phf_macros"
version = "0.10.0" version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" checksum = "cd94351ac44e70e56b59883e15029a5135f902a8a3020f9c18d580a420e526aa"
dependencies = [ dependencies = [
"phf_generator", "phf_generator",
"phf_shared", "phf_shared",
"proc-macro-hack",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn",
@ -1106,9 +1102,9 @@ dependencies = [
[[package]] [[package]]
name = "phf_shared" name = "phf_shared"
version = "0.10.0" version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" checksum = "9dd5609d4b2df87167f908a32e1b146ce309c16cf35df76bc11f440b756048e4"
dependencies = [ dependencies = [
"siphasher", "siphasher",
] ]
@ -1187,12 +1183,6 @@ dependencies = [
"version_check", "version_check",
] ]
[[package]]
name = "proc-macro-hack"
version = "0.5.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.39" version = "1.0.39"
@ -1358,9 +1348,9 @@ dependencies = [
[[package]] [[package]]
name = "rustyline" name = "rustyline"
version = "9.1.2" version = "10.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db7826789c0e25614b03e5a54a0717a86f9ff6e6e5247f92b369472869320039" checksum = "1d1cd5ae51d3f7bf65d7969d579d502168ef578f289452bd8ccc91de28fda20e"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"cfg-if", "cfg-if",
@ -1373,7 +1363,6 @@ dependencies = [
"nix", "nix",
"radix_trie", "radix_trie",
"scopeguard", "scopeguard",
"smallvec",
"unicode-segmentation", "unicode-segmentation",
"unicode-width", "unicode-width",
"utf8parse", "utf8parse",

4
boa_cli/Cargo.toml

@ -14,13 +14,13 @@ default-run = "boa"
[dependencies] [dependencies]
boa_engine = { path = "../boa_engine", features = ["deser", "console"], version = "0.15.0" } boa_engine = { path = "../boa_engine", features = ["deser", "console"], version = "0.15.0" }
boa_interner = { path = "../boa_interner", version = "0.15.0" } boa_interner = { path = "../boa_interner", version = "0.15.0" }
rustyline = "9.1.2" rustyline = "10.0.0"
rustyline-derive = "0.7.0" rustyline-derive = "0.7.0"
clap = { version = "3.2.12", features = ["derive"] } clap = { version = "3.2.12", features = ["derive"] }
serde_json = "1.0.82" serde_json = "1.0.82"
colored = "2.0.0" colored = "2.0.0"
regex = "1.6.0" regex = "1.6.0"
phf = { version = "0.10.1", features = ["macros"] } phf = { version = "0.11.0", features = ["macros"] }
[target.x86_64-unknown-linux-gnu.dependencies] [target.x86_64-unknown-linux-gnu.dependencies]
jemallocator = "0.5.0" jemallocator = "0.5.0"

5
boa_cli/src/main.rs

@ -180,7 +180,7 @@ where
Ok(()) Ok(())
} }
pub fn main() -> Result<(), std::io::Error> { pub fn main() -> Result<(), io::Error> {
let args = Opt::parse(); let args = Opt::parse();
let mut context = Context::default(); let mut context = Context::default();
@ -213,7 +213,8 @@ pub fn main() -> Result<(), std::io::Error> {
}) })
.build(); .build();
let mut editor = Editor::with_config(config); let mut editor =
Editor::with_config(config).map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
editor.load_history(CLI_HISTORY).map_err(|err| match err { editor.load_history(CLI_HISTORY).map_err(|err| match err {
ReadlineError::Io(e) => e, ReadlineError::Io(e) => e,
e => io::Error::new(io::ErrorKind::Other, e), e => io::Error::new(io::ErrorKind::Other, e),

Loading…
Cancel
Save