Grid::new(usize, usize) panics undocumented
sadneo opened this issue · 2 comments
sadneo commented
This doesn't work
use grid::Grid;
fn main() {
let grid : Grid<u8> = Grid::new(usize::MAX, usize::MAX);
}
while this does
use grid::Grid;
2 fn main() {
3 let grid : Grid<u8> = Grid::new(u8::MAX, u8::MAX);
4 }
Not really sure how the type annotations would look like, but you should probably update the documentation to say that grid lengths can only be sqrt(usize::MAX)
becheran commented
True. It is not possible to have a grid with cols * rows > usize. I will add a note in the docs. Thx
becheran commented
Updated docs in 0.8.0