diff --git a/src/main.rs b/src/main.rs index 229a749..4df1fde 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,8 @@ fn main() { let file = args().nth(1).expect("Usage : boxon "); let content = fs::read_to_string(&file).unwrap_or_else(|_| panic!("Could not read file '{file}'.")); let mut grid = Grid::from(content); - grid.fix(); + let count = grid.fix(); + println!("Fixed {count} characters."); let content: String = grid.into(); fs::write(&file, content).unwrap_or_else(|_| panic!("Could not write result to file '{file}'.")); } diff --git a/test/out.txt b/test/out.txt index 1abe12b..9f3cf9b 100644 --- a/test/out.txt +++ b/test/out.txt @@ -1,21 +1,19 @@ this is a normalized data table diagram. -+----------------+ -|USERS BY EMAIL | -+--+-----+-------+ -|id|email|user_id| -+--+-----+-------+ -| 1|b@o.b| 1| -| 2|c@r.l| 2| -+--+-----+-------+ - +---------------+ - |USERS | - +--+--------+---+ - |id| name|age| - +--+--------+---+ - | 1| bob| 19| - | 2| charlie| 23| - +--+--------+---+ - - +┌────────────────┐ +│USERS BY EMAIL │ +├──┬─────┬───────┤ +│id│email│user_id│ +├──┼─────┼───────┤ +│ 1│b@o.b│ 1│ +│ 2│c@r.l│ 2│ +└──┴─────┴───────┘ + ┌───────────────┐ + │USERS │ + ├──┬────────┬───┤ + │id│ name│age│ + ├──┼────────┼───┤ + │ 1│ bob│ 19│ + │ 2│ charlie│ 23│ + └──┴────────┴───┘