Open neocturne opened 2 months ago
Any suggestions for a good example? In my project I'm using it for benchmarking a parser that creates a token stream/tree which references the input, but that seems too complex for an example (and it uses a separate parser crate). I guess I could do something simple like collecting the result of str::matches()
in a Vec
that gets returned?
This allows benchmarks using bench_refs() and bench_local_refs() to capture the input lifetimes, as was already suggested by TODO comments in the code.
By naming the input lifetime, the output type
O
is allowed to capture this lifetime. TheI: 'i
condition for&'i mut I
must be made explicit now with named'i
, or the code won't compile.First commit adds tests that don't compile, second commit makes them compile.