use crate::prelude::*;
pub fn split_auth(value: &str) -> (Option<&str>, &str, Option<&str>) {
unsafe {
let (u, h, p) = split_auth_bytes(value.as_bytes());
(
u.map(|u| str::from_utf8_unchecked(u)),
str::from_utf8_unchecked(h) ,
p.map(|p| str::from_utf8_unchecked(p)),
)
}
}
pub fn split_pqf(value: &str) -> (&str, Option<&str>, Option<&str>) {
unsafe {
let (p, q, f) = split_pqf_bytes(value.as_bytes());
(
str::from_utf8_unchecked(p) ,
q.map(|q| str::from_utf8_unchecked(q)),
f.map(|f| str::from_utf8_unchecked(f)),
)
}
}
pub fn pop_fragment(value: &str) -> (&str, Option<&str>) {
unsafe {
let (r, f) = pop_fragment_bytes(value.as_bytes());
(
str::from_utf8_unchecked(r) ,
f.map(|f| str::from_utf8_unchecked(f)),
)
}
}
pub fn pop_query(value: &str) -> (&str, Option<&str>) {
unsafe {
let (r, q) = pop_query_bytes(value.as_bytes());
(
str::from_utf8_unchecked(r) ,
q.map(|q| str::from_utf8_unchecked(q)),
)
}
}
pub fn pop_special_path(value: &str) -> (&str, &str) {
unsafe {
let (auth, path) = pop_special_path_bytes(value.as_bytes());
(
str::from_utf8_unchecked(auth),
str::from_utf8_unchecked(path),
)
}
}
pub fn pop_non_special_path(value: &str) -> (&str, &str) {
unsafe {
let (auth, path) = pop_non_special_path_bytes(value.as_bytes());
(
str::from_utf8_unchecked(auth),
str::from_utf8_unchecked(path),
)
}
}