-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Thank you for this crate!
footer() panics in the case where no rows have been written and borders and padding are left at defaults.
It happens here (currently line 475):
let border_width = if self.borders { 1 } else { 0 } + if self.padding { 1 } else { 0 };
let foot_width = self.width - (border_width * 2);
In this case, self.width is stil 0, border_width becomes "1" becoming:
let foot_width = 0 - (1 * 2) // panic - attempt to subtract with overflow
finish() doesn't panic for obvious reasons - but does print what amounts to an empty line.
I sort of hoped that in the case of no printed rows, I would be able to print an empty table or even a table with a "No data" row or something like that. I'm not sure how useful this is, though. I think it's probably worth fixing the panic, though.
Thanks!
Metadata
Metadata
Assignees
Labels
No labels