File tree Expand file tree Collapse file tree 2 files changed +0
-19
lines changed Expand file tree Collapse file tree 2 files changed +0
-19
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,3 @@ version = "0.1.0"
4
4
edition = " 2018"
5
5
authors = [
" Renato Athaydes <[email protected] >" ]
6
6
license = " "
7
-
8
- # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
9
-
10
- [dependencies ]
11
- num-bigint = " 0.4"
12
- lazy_static = " 1.4.0"
Original file line number Diff line number Diff line change @@ -5,16 +5,8 @@ use std::io::{self, BufRead};
5
5
use std:: path:: Path ;
6
6
use std:: fmt:: { self , Display , Formatter } ;
7
7
8
- use lazy_static:: lazy_static;
9
- use num_bigint:: { BigUint , ToBigUint } ;
10
-
11
8
type Dictionary = HashMap < Vec < u8 > , Vec < String > > ;
12
9
13
- lazy_static ! {
14
- static ref ONE : BigUint = 1 . to_biguint( ) . unwrap( ) ;
15
- static ref TEN : BigUint =10 . to_biguint( ) . unwrap( ) ;
16
- }
17
-
18
10
#[ derive( Debug , Copy , Clone ) ]
19
11
enum WordOrDigit < ' a > {
20
12
Word ( & ' a str ) ,
@@ -135,11 +127,6 @@ fn word_to_number(word: &str) -> Vec<u8> {
135
127
. collect ( )
136
128
}
137
129
138
- fn nth_digit ( digits : & [ u8 ] , i : usize ) -> BigUint {
139
- let ch = digits. get ( i) . expect ( "index out of bounds" ) ;
140
- ( ( * ch as usize ) - ( '0' as usize ) ) . to_biguint ( ) . unwrap ( )
141
- }
142
-
143
130
fn char_to_digit ( ch : char ) -> u8 {
144
131
match ch. to_ascii_lowercase ( ) {
145
132
'e' => 0 ,
You can’t perform that action at this time.
0 commit comments