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

use if let Some(x) = arr.dim() instead of checking is_array #7

Closed
daniellga opened this issue Feb 4, 2024 · 0 comments
Closed

use if let Some(x) = arr.dim() instead of checking is_array #7

daniellga opened this issue Feb 4, 2024 · 0 comments

Comments

@daniellga
Copy link
Owner

fn new_from_values(arr: Robj, dtype: &HDataType) -> Robj {
    assert!(arr.is_array());

    // Ok to unwrap since it was checked that robj is an array.
    let mut dim: Vec<usize> = arr
        .dim()
        .unwrap()
        .iter()
        .map(|z| z.inner() as usize)
        .collect();
    dim.reverse();
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

No branches or pull requests

1 participant