chore: cargo fmt, clippy

This commit is contained in:
Gurwinder Singh
2019-08-17 09:07:32 +05:30
committed by Sean McArthur
parent e72d6dc189
commit f46840f3fa
43 changed files with 785 additions and 870 deletions

View File

@@ -1,8 +1,8 @@
use walkdir::WalkDir;
use std::collections::HashMap;
use std::env;
use std::path::Path;
use std::collections::HashMap;
fn main() {
let args: Vec<_> = env::args().collect();
@@ -30,7 +30,9 @@ fn main() {
// Now, split that into the group and the name
let module = fixture_path.split("/").next().unwrap();
tests.entry(module.to_string()).or_insert(vec![])
tests
.entry(module.to_string())
.or_insert(vec![])
.push(fixture_path.to_string());
}
@@ -49,9 +51,7 @@ fn main() {
println!(" {} => {{", module);
for test in tests {
let ident = test
.split("/").nth(1).unwrap()
.split(".").next().unwrap();
let ident = test.split("/").nth(1).unwrap().split(".").next().unwrap();
println!(" ({}, {:?});", ident, test);
}

View File

@@ -98,18 +98,17 @@ impl Node {
}
}
fn compute_transition(&self,
byte: Option<usize>,
start: &Node,
root: &Node,
steps_remaining: usize)
{
fn compute_transition(
&self,
byte: Option<usize>,
start: &Node,
root: &Node,
steps_remaining: usize,
) {
if steps_remaining == 0 {
let (byte, target) = match byte {
Some(256) => (None, None),
_ => {
(byte, Some(self.id.unwrap_or(0)))
}
_ => (byte, Some(self.id.unwrap_or(0))),
};
start.transitions.borrow_mut().push(Transition {
@@ -257,8 +256,6 @@ pub fn main() {
println!("];");
}
const TABLE: &'static str = r##"
( 0) |11111111|11000 1ff8 [13]
( 1) |11111111|11111111|1011000 7fffd8 [23]