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

Update ascii to version 0.7 #114

Merged
merged 1 commit into from
Jun 26, 2016
Merged

Update ascii to version 0.7 #114

merged 1 commit into from
Jun 26, 2016

Conversation

tomprogrammer
Copy link
Contributor

These are some rather simple changes to update the ascii crate to the latest version.

@frewsxcv
Copy link
Member

It looks like examples/serve-root.rs relies on the old ascii version. Could you update that file as well? If not I can update it later

@tomprogrammer
Copy link
Contributor Author

I force-pushed the changes. Somehow I forgot to check the examples and tests..

@tomaka
Copy link
Member

tomaka commented Jun 25, 2016

It looks like ascii is now part of the stdlib, except that I'm not sure if all the features are present. If so, then we should eventually use it instead.
But for now that PR looks good.

@tomprogrammer
Copy link
Contributor Author

tomprogrammer commented Jun 25, 2016

Yes, the std::ascii::AsciiExt trait is for "ASCII-subset only operations on string slices". The difference between the ascii crate and the trait in the standard library is, that ascii can guarantee the encoding of the entire string, like str guarantees it for UTF-8.

The Header struct encodes the requirement of ascii-only values in the type AsciiString for the value field. When the AsciiExt trait is used, there have to be more checks throughout the code.
Things like php.stderr.clone().as_ascii_str() certainly could be rewritten using AsciiExt::is_ascii().

@frewsxcv frewsxcv merged commit c26a66f into tiny-http:master Jun 26, 2016
@frewsxcv
Copy link
Member

Thanks!

@tomprogrammer tomprogrammer deleted the update-ascii branch June 26, 2016 14:50
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.

None yet

3 participants