From 6887365092aae626f61db988a5204ef45d0c6c57 Mon Sep 17 00:00:00 2001 From: Seo Sanghyeon Date: Tue, 15 Oct 2019 21:40:59 +0900 Subject: [PATCH] Update lexical to 4 --- Cargo.lock | 12 ++++++------ vm/Cargo.toml | 2 +- vm/src/obj/objfloat.rs | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bdd7435f4d..3b8e35ffd1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -655,17 +655,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "lexical" -version = "2.2.2" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "lexical-core 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "lexical-core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "lexical-core" -version = "0.4.6" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1288,7 +1288,7 @@ dependencies = [ "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lexical 2.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lexical 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2199,8 +2199,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum lalrpop-util 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c277d18683b36349ab5cd030158b54856fca6bb2d5dc5263b06288f486958b7c" "checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -"checksum lexical 2.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8e0d09e60c187a6d0a3fa418aec8587c6a4ae9de872f6126f2134f319b5ed10d" -"checksum lexical-core 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2304bccb228c4b020f3a4835d247df0a02a7c4686098d4167762cfbbe4c5cb14" +"checksum lexical 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0afaeae1c07c575338ef6809875bfea8daa9ea8b2ee381ef1f93ba0c6e32f003" +"checksum lexical-core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d7043aa5c05dd34fb73b47acb8c3708eac428de4545ea3682ed2f11293ebd890" "checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba" "checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" diff --git a/vm/Cargo.toml b/vm/Cargo.toml index 15ea707aa3..4eca990138 100644 --- a/vm/Cargo.toml +++ b/vm/Cargo.toml @@ -47,7 +47,7 @@ caseless = "0.2.1" chrono = "=0.4.7" unicode-xid = "0.2.0" lazy_static = "^1.0.1" -lexical = "2.0.0" +lexical = "4" itertools = "^0.8.0" hex = "0.4.0" hexf-parse = "0.1.0" diff --git a/vm/src/obj/objfloat.rs b/vm/src/obj/objfloat.rs index 62624bc9c8..2adc291132 100644 --- a/vm/src/obj/objfloat.rs +++ b/vm/src/obj/objfloat.rs @@ -607,7 +607,7 @@ fn to_float(vm: &VirtualMachine, obj: &PyObjectRef) -> PyResult { } else if objtype::isinstance(&obj, &vm.ctx.int_type()) { objint::get_float_value(&obj, vm)? } else if objtype::isinstance(&obj, &vm.ctx.str_type()) { - match lexical::try_parse(objstr::get_value(&obj).trim()) { + match lexical::parse(objstr::get_value(&obj).trim()) { Ok(f) => f, Err(_) => { let arg_repr = vm.to_pystr(obj)?; @@ -618,7 +618,7 @@ fn to_float(vm: &VirtualMachine, obj: &PyObjectRef) -> PyResult { } } } else if objtype::isinstance(&obj, &vm.ctx.bytes_type()) { - match lexical::try_parse(objbytes::get_value(&obj).as_slice()) { + match lexical::parse(objbytes::get_value(&obj).as_slice()) { Ok(f) => f, Err(_) => { let arg_repr = vm.to_pystr(obj)?;