Skip to content

libstd: Skip trailing whitespaces after outer rparen #1912

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

Merged
merged 2 commits into from
Feb 29, 2012

Conversation

tychosci
Copy link
Contributor

Typical JSON file ends with trailing newlines, but json::from_str handles it as invalid JSON in current implementation.

This makes "{ \"foo\": 1 }\n" and "[ 1 ]\n" valid json string
@tychosci
Copy link
Contributor Author

I found that JSON value which ends with trailing whitespaces (e.g. "1\n", "\"foo\" ", "true\t", "false\n\n", and "null \n") also be valid, not only object and list.
I'll add another commit to handle it correctly.

erickt added a commit that referenced this pull request Feb 29, 2012
libstd: Skip trailing whitespaces after outer rparen
@erickt erickt merged commit 3d104cf into rust-lang:master Feb 29, 2012
@erickt
Copy link
Contributor

erickt commented Feb 29, 2012

Thanks for catching that!

celinval added a commit to celinval/rust-dev that referenced this pull request Jun 4, 2024
This change add support to rlib libraries and add proper error handling for crate types that aren't supported. We also no longer crash if there was no supported target found.
Kobzol pushed a commit to Kobzol/rust that referenced this pull request Dec 30, 2024
Minor additions and resorting.
bors pushed a commit to rust-lang-ci/rust that referenced this pull request Jan 2, 2025
Minor additions and resorting.
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