Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: refactor router and router inner #566

Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions common/src/wasm.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use hyper::http::{HeaderMap, Method, Request, Response, StatusCode, Uri, Version};
use hyper::http::{self, HeaderMap, Method, Request, Response, StatusCode, Uri, Version};
oddgrd marked this conversation as resolved.
Show resolved Hide resolved
use rmps::Serializer;
use serde::{Deserialize, Serialize};

Expand All @@ -20,8 +20,8 @@ pub struct RequestWrapper {
pub headers: HeaderMap,
}

impl From<hyper::http::request::Parts> for RequestWrapper {
fn from(parts: hyper::http::request::Parts) -> Self {
impl From<http::request::Parts> for RequestWrapper {
fn from(parts: http::request::Parts) -> Self {
RequestWrapper {
method: parts.method,
uri: parts.uri,
Expand All @@ -41,7 +41,7 @@ impl RequestWrapper {
}

/// Consume the wrapper and return a request builder with `Parts` set
pub fn into_request_builder(self) -> hyper::http::request::Builder {
pub fn into_request_builder(self) -> http::request::Builder {
let mut request = Request::builder()
.method(self.method)
.version(self.version)
Expand Down Expand Up @@ -69,8 +69,8 @@ pub struct ResponseWrapper {
pub headers: HeaderMap,
}

impl From<hyper::http::response::Parts> for ResponseWrapper {
fn from(parts: hyper::http::response::Parts) -> Self {
impl From<http::response::Parts> for ResponseWrapper {
fn from(parts: http::response::Parts) -> Self {
ResponseWrapper {
status: parts.status,
version: parts.version,
Expand All @@ -89,7 +89,7 @@ impl ResponseWrapper {
}

/// Consume the wrapper and return a response builder with `Parts` set
pub fn into_response_builder(self) -> hyper::http::response::Builder {
pub fn into_response_builder(self) -> http::response::Builder {
let mut response = Response::builder()
.status(self.status)
.version(self.version);
Expand All @@ -106,8 +106,8 @@ impl ResponseWrapper {
#[cfg(test)]
mod test {
use super::*;
use http::HeaderValue;
use hyper::body::Body;
use hyper::http::HeaderValue;

#[test]
fn request_roundtrip() {
Expand Down
Loading