1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
extern crate toml;
extern crate reqwest;
pub mod gitignore;
pub mod fetch;
fn str_cmp(first: &str, last: &str) -> i32 {
let mut diff = 0;
let mut firsti = first.chars();
let mut lasti = last.chars();
loop {
let firstc = firsti.next();
let lastc = lasti.next();
if firstc.is_some() ^ lastc.is_some() {
diff += 1;
} else if firstc.is_some() && firstc.is_some() {
let firstc = firstc.unwrap();
let lastc = lastc.unwrap();
if firstc != lastc {
diff += 1;
}
} else {
break diff;
}
}
}