fix(uri): make absolute-form uris always have a path

This commit is contained in:
Sean McArthur
2018-02-08 16:09:25 -08:00
parent 8e57338ef0
commit a9413d7367
2 changed files with 29 additions and 2 deletions

View File

@@ -30,6 +30,13 @@ impl ByteStr {
unsafe { str::from_utf8_unchecked(self.0.as_ref()) }
}
pub fn insert(&mut self, idx: usize, ch: char) {
let mut s = self.as_str().to_owned();
s.insert(idx, ch);
let bytes = Bytes::from(s);
self.0 = bytes;
}
#[cfg(feature = "compat")]
pub fn into_bytes(self) -> Bytes {
self.0