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

Support for no_std #54

Merged
merged 10 commits into from
Nov 1, 2016
Merged

Support for no_std #54

merged 10 commits into from
Nov 1, 2016

Conversation

m4rw3r
Copy link
Owner

@m4rw3r m4rw3r commented Sep 6, 2016

Support for using Chomp without Rust's standard library, instead relying solely on the core module.

  • types::Buffer::to_vec and types::Buffer::as_vec will not be a part of Chomp when built with core.
  • buffer module will require some refactoring to allow for usage without std::io, and the buffer for the fixed-buffer needs to be user-supplied (because we can't allocate ourselves). See https://github.com/whitequark/rust-log_buffer for a good example on how to use user-provided buffers.
  • parsers::Error cannot implement std::error::Error

@m4rw3r m4rw3r added this to the Version 1.0.0 milestone Sep 6, 2016
@m4rw3r
Copy link
Owner Author

m4rw3r commented Oct 11, 2016

Decided to skip the buffer module for now, #57 should hopefully enable at least limited helper functionality for buffers without requiring std.

@m4rw3r
Copy link
Owner Author

m4rw3r commented Nov 1, 2016

Does not play well with examples since they require std. And cargo doesn't seem to have any feature which enables examples to depend on a feature defined in Cargo.toml. Temporarily renaming the examples/ directory when running cargo test works but is suboptimal, and adding feature-tests in examples is also a bad idea since they require certain features to function and #[cfg(feature="std")] all over the place would be distracting and not representative of the normal usage of Chomp.

@m4rw3r
Copy link
Owner Author

m4rw3r commented Nov 1, 2016

When rust-lang/cargo#1570 has been resolved we can also add --no-default-features to automatic tests. Until then manual testing is required.

@m4rw3r m4rw3r merged commit 192e652 into master Nov 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant