In this last PR, I have introduced a getter for Span in order to be able to access the private input field of a Span. This allows to access the original input string without having to pass its reference everywhere in function arguments. In my personal project, I use this feature to be able to merge Spans.
There is no reason not to add this function to other types that also have this private field and a public as_str() function. I have added meaningful doc and tests and run cargo fmt.
I also renamed my tests to all have different names, making test debugging via commands like cargo test <get_input_test> -- --nocapture non-ambiguous.
Hello Pest team.
This PR is a followup to my last PR Merging Spans :recycle: #887.
In this last PR, I have introduced a getter for
Span
in order to be able to access the privateinput
field of aSpan
. This allows to access the original input string without having to pass its reference everywhere in function arguments. In my personal project, I use this feature to be able to mergeSpan
s.There is no reason not to add this function to other types that also have this private field and a public
as_str()
function. I have added meaningful doc and tests and runcargo fmt
.I also renamed my tests to all have different names, making test debugging via commands like
cargo test <get_input_test> -- --nocapture
non-ambiguous.