better split

This commit is contained in:
Alex 2021-12-08 17:36:01 +01:00
parent 8d47bef9d4
commit 0e6e60d35a
No known key found for this signature in database
GPG Key ID: EDABF9711E244EB1
1 changed files with 5 additions and 2 deletions

View File

@ -98,8 +98,11 @@ fn parse_tricot_tag(
return None;
}
let (host, path_prefix) = match splits[1].split_once('/') {
Some((h, p)) => (h, Some(format!("/{}", p))),
let (host, path_prefix) = match splits[1].find('/') {
Some(i) => {
let (host, pp) = splits[1].split_at(i);
(host, Some(pp.to_string()))
},
None => (splits[1], None),
};