Skip to content

Commit 6ee9491

Browse files
committed
Implement From<PathAndQuery> for Bytes
This allows getting a `Bytes` instance from a `PathAndQuery` without any copying.
1 parent 5f0c866 commit 6ee9491

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/uri/path.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,12 @@ impl hash::Hash for PathAndQuery {
377377
}
378378
}
379379

380+
impl From<PathAndQuery> for Bytes {
381+
fn from(value: PathAndQuery) -> Self {
382+
value.data.into()
383+
}
384+
}
385+
380386
// ===== PartialEq / PartialOrd =====
381387

382388
impl PartialEq for PathAndQuery {

0 commit comments

Comments
 (0)