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

View file

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