From cf47e4c98daf4f5d0139d4ab83ba40303daa21c4 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 17 Jun 2023 00:09:41 +1000 Subject: [PATCH] Drop num_integer crate --- Cargo.lock | 11 ----------- rslib/Cargo.toml | 1 - rslib/src/notes/mod.rs | 4 ++-- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eb601e91f..bee605ecf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -119,7 +119,6 @@ dependencies = [ "itertools", "lazy_static", "nom", - "num-integer", "num_cpus", "num_enum", "once_cell", @@ -2494,16 +2493,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.15" diff --git a/rslib/Cargo.toml b/rslib/Cargo.toml index 8d7cd95cc..ea9eea70f 100644 --- a/rslib/Cargo.toml +++ b/rslib/Cargo.toml @@ -77,7 +77,6 @@ id_tree = "1.8.0" itertools = "0.10.5" lazy_static = "1.4.0" nom = "7.1.3" -num-integer = "0.1.45" num_cpus = "1.15.0" num_enum = "0.6.1" once_cell = "1.17.1" diff --git a/rslib/src/notes/mod.rs b/rslib/src/notes/mod.rs index d9299a685..40fdabf68 100644 --- a/rslib/src/notes/mod.rs +++ b/rslib/src/notes/mod.rs @@ -9,7 +9,6 @@ use std::collections::HashSet; use anki_proto::notes::note_fields_check_response::State as NoteFieldsState; use itertools::Itertools; -use num_integer::Integer; use sha1::Digest; use sha1::Sha1; @@ -312,7 +311,8 @@ fn anki_base91(n: u64) -> String { pub fn to_base_n(mut n: u64, table: &[u8]) -> String { let mut buf = String::new(); while n > 0 { - let (q, r) = n.div_rem(&(table.len() as u64)); + let tablelen = table.len() as u64; + let (q, r) = (n / tablelen, n % tablelen); buf.push(table[r as usize] as char); n = q; }