feat(uri): redesign RequestUri type into Uri

Closes #1000

BREAKING CHANGE: The name of `RequestUri` has changed to `Uri`. It is no
  longer an `enum`, but an opaque struct with getter methods.
This commit is contained in:
Guillaume Gomez
2017-01-14 14:38:21 +01:00
committed by Sean McArthur
parent 1868f8548d
commit 9036443e6b
10 changed files with 297 additions and 136 deletions

View File

@@ -574,6 +574,7 @@ mod tests {
use mock::AsyncIo;
use super::{Conn, Writing};
use ::uri::Uri;
#[test]
fn test_conn_init_read() {
@@ -585,10 +586,7 @@ mod tests {
match conn.poll().unwrap() {
Async::Ready(Some(Frame::Message { message, body: false })) => {
assert_eq!(message, MessageHead {
subject: ::http::RequestLine(::Get, ::RequestUri::AbsolutePath {
path: "/".to_string(),
query: None,
}),
subject: ::http::RequestLine(::Get, Uri::new("/").unwrap()),
.. MessageHead::default()
})
},