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

Implement Span::get #681

Merged
merged 6 commits into from Aug 4, 2022
Merged

Implement Span::get #681

merged 6 commits into from Aug 4, 2022

Conversation

Alextopher
Copy link
Contributor

Partially revives #456 and merge would partially close #455.

This implementation changes the name of the new feature in #456 from Span::sub_span to Span::get to have parity with str::get.

This implementation does not require std.

@Alextopher Alextopher requested a review from a team as a code owner August 3, 2022 13:12
@Alextopher Alextopher requested review from tomtau and removed request for a team August 3, 2022 13:12
pest/src/span.rs Outdated Show resolved Hide resolved
pest/src/span.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this may still fail in no_std... if you'd like to test no_std, you can try to build it as follows: rustup run nightly -- cargo build -j1 -Z build-std=core,alloc --target x86_64-unknown-linux-gnu

pest/src/span.rs Outdated Show resolved Hide resolved
@Alextopher
Copy link
Contributor Author

I have never been in a no std environment before. Actually in general this is my first Rust OSS participation.

I couldn't get your suggestion to work but https://lib.rs/crates/cargo-no-std-check seemed to do the trick to test the build for no_std.

@tomtau
Copy link
Contributor

tomtau commented Aug 4, 2022

Thank you and congratulations on your first Rust OSS participation! 🎉

@tomtau tomtau merged commit 7b900c9 into pest-parser:master Aug 4, 2022
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.

Expose more ways for users to manipulate Span
2 participants