pattern matching on String in Rust Language

rust, string

Solution

No. Pattern matching does not do partial string matching. Splitting and slicing and iterating are the only ways you can get the contents of it.

Problem

Is possible to parse the `<path>` part from `GET /<path> HTTP/1.1` using pattern matching, or anything gracefully rather than direct string manipulation such as `split` or `slice`

Original source