Add count display.
This commit is contained in:
parent
87266e7d54
commit
abc6241353
2 changed files with 18 additions and 19 deletions
|
@ -4,7 +4,8 @@ fn main() {
|
|||
let file = args().nth(1).expect("Usage : boxon <file>");
|
||||
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}'."));
|
||||
}
|
||||
|
|
34
test/out.txt
34
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│
|
||||
└──┴────────┴───┘
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue