From 5aa67492418228084f79c74b853dc035e4c9b6ca Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 26 Dec 2021 00:32:08 +0800 Subject: [PATCH] remove num-traits --- Cargo.lock | 11 ----------- nac3core/Cargo.toml | 1 - nac3parser/Cargo.toml | 1 - nac3parser/src/lexer.rs | 3 +-- 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b88398a3..5aa5078f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -511,7 +511,6 @@ dependencies = [ "insta", "itertools", "nac3parser", - "num-traits", "parking_lot", "rayon", "test-case", @@ -527,7 +526,6 @@ dependencies = [ "lalrpop-util", "log", "nac3ast", - "num-traits", "phf", "unic-emoji-char", "unic-ucd-ident", @@ -550,15 +548,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" -[[package]] -name = "num-traits" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" -dependencies = [ - "autocfg", -] - [[package]] name = "num_cpus" version = "1.13.1" diff --git a/nac3core/Cargo.toml b/nac3core/Cargo.toml index 2c508979..64408af8 100644 --- a/nac3core/Cargo.toml +++ b/nac3core/Cargo.toml @@ -5,7 +5,6 @@ authors = ["M-Labs"] edition = "2018" [dependencies] -num-traits = "0.2" itertools = "0.10.1" crossbeam = "0.8.1" parking_lot = "0.11.1" diff --git a/nac3parser/Cargo.toml b/nac3parser/Cargo.toml index 34e94284..926b2a29 100644 --- a/nac3parser/Cargo.toml +++ b/nac3parser/Cargo.toml @@ -14,7 +14,6 @@ lalrpop = "0.19.6" nac3ast = { path = "../nac3ast" } lalrpop-util = "0.19.6" log = "0.4.1" -num-traits = "0.2" unic-emoji-char = "0.9" unic-ucd-ident = "0.9" unicode_names2 = "0.4" diff --git a/nac3parser/src/lexer.rs b/nac3parser/src/lexer.rs index 44a0c0c8..10e871c8 100644 --- a/nac3parser/src/lexer.rs +++ b/nac3parser/src/lexer.rs @@ -5,7 +5,6 @@ pub use super::token::Tok; use crate::ast::Location; use crate::error::{LexicalError, LexicalErrorType}; -use num_traits::identities::Zero; use std::char; use std::cmp::Ordering; use std::str::FromStr; @@ -364,7 +363,7 @@ where // parse should only fail because of overflow. let value = value_text.parse::().ok(); let nonzero = match value { - Some(value) => !value.is_zero(), + Some(value) => value != 0i64, None => true }; if start_is_zero && nonzero {