Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flip cols/rows in out of range panic #21

Merged
merged 1 commit into from
Aug 22, 2022
Merged

flip cols/rows in out of range panic #21

merged 1 commit into from
Aug 22, 2022

Conversation

IsaacCloos
Copy link
Contributor

insert_row & insert_col returning inaccurate error messages.

I believe flipping the size references fixes the issue. If not please let me know 😄

Example

use grid::*;

fn main() {
    let mut grid = grid![
        [1,2,3]
        [4,5,6]
    ];

    // thread 'main' panicked at 'Out of range. Index was 3, but must be less or equal to 3.'
    //                                                                                    ^ should say 2
    grid.insert_row(3, vec![7,8,9]);

    // thread 'main' panicked at 'Out of range. Index was 4, but must be less or equal to 2.'
    //                                                                                    ^ should say 3
    grid.insert_col(4, vec![11, 11])
}

Criticism Welcome

Was returning inaccurate error messages
Copy link
Owner

@becheran becheran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. Thank you. Copy paste error 🤦‍♂️

@becheran becheran merged commit a74d57d into becheran:master Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants