8000 Produces confusing error on empty input · Issue #37 · rs-tml/rstml · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Produces confusing error on empty input #37

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

Closed
ModProg opened this issue Oct 4, 2023 · 1 comment · Fixed by #40
Closed

Produces confusing error on empty input #37

ModProg opened this issue Oct 4, 2023 · 1 comment · Fixed by #40

Comments

@ModProg
Copy link
ModProg commented Oct 4, 2023

Parsing an empty input yields:

Object parsing failed, but no additional info was provided

I'd argue that this should just return an empty Vec<Node>, but if you insist on an error it should be more descriptive.

Test:

#[test]
fn test_empty_input() -> Result<()> {
    let tokens = quote! {};
    let nodes = parse2(tokens)?;

    assert!(nodes.is_empty());

    Ok(())
}
@vldm
Copy link
Collaborator
vldm commented Oct 9, 2023

Yes, i agree with you. It should return empty Vec instead of returning error.

@vldm vldm mentioned this issue Oct 11, 2023
@vldm vldm closed this as completed in #40 Oct 11, 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.

2 participants
0