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

Deserialising array from Value allows extraneous values #405

Closed
juntyr opened this issue Aug 26, 2022 · 0 comments · Fixed by #406
Closed

Deserialising array from Value allows extraneous values #405

juntyr opened this issue Aug 26, 2022 · 0 comments · Fixed by #406
Assignees

Comments

@juntyr
Copy link
Member

juntyr commented Aug 26, 2022

The following should fail as the array is of length two but three elements are provided.

let err = Value::Seq(vec![
        Value::Number(Number::new(1)),
        Value::Number(Number::new(2)),
        Value::Number(Number::new(3)),
    ])
    .into_rust::<[i32; 2]>()
    .unwrap_err();

However, deserialising succeeds.

@juntyr juntyr self-assigned this Aug 26, 2022
juntyr added a commit to juntyr/ron that referenced this issue Aug 26, 2022
…eous item check for `Value::Seq`
juntyr added a commit that referenced this issue Aug 26, 2022
juntyr added a commit to juntyr/ron that referenced this issue Aug 15, 2023
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 a pull request may close this issue.

1 participant