soenkehahn / cradle

Rust library for running child processes
Creative Commons Zero v1.0 Universal
38 stars 5 forks source link

Allow only `&'static str` in `Split` #191

Closed soenkehahn closed 3 years ago

soenkehahn commented 3 years ago

This narrows down the types allowed as arguments to Split (and therefore the types of values after % in macros). The reasoning is that

For more discussion, see https://www.reddit.com/r/rust/comments/poqlo9/cradle_run_child_processes_with_ease/hd00yla/?utm_source=reddit&utm_medium=web2x&context=3.

Do we have any reasonable usecases where arguments to Split are not &'static str?

casey commented 3 years ago

I think this is reasonable. I can't think of any really important use cases for splitting non-static strings, and if someone has a use case, we can easily re-enable it.

casey commented 3 years ago

We should probably also only provide Input implementations for SplitWhitespace<'static>, Split<'static>, and SplitAsciiWhitespaceCopy<'static>.