Skip to main content

split_version

Function split_version 

Source
pub fn split_version(path: &str) -> (Option<String>, String)
Expand description

Split an optional /v<major>.<minor> prefix off a path.

Returns the version as written ("1.45") and the rest of the path. A first segment that starts with v but is not a version is left alone, so it routes to a 404 rather than being mistaken for one.