pub fn split_versioned_name(
full_name: &str,
) -> Result<(String, TinyVersion), SplitError>
Expand description
Splits a versioned name into its package name and version.
§Arguments
full_name
- A string in the format produced byTinyVersion::versioned_name
, e.g."mypackage-1.2.3"
or"mypackage-1.2.3-beta"
.
§Returns
A tuple containing the package name and the parsed TinyVersion
.
§Errors
Returns a SplitError
if:
- The input does not contain a hyphen (thus, no valid separator between package and version).
- The version part cannot be parsed as a valid
TinyVersion
.