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

Simplify the http_loader code. #14362

Merged
merged 14 commits into from Nov 26, 2016

Remove the HttpRequest trait.

  • Loading branch information
Ms2ger committed Nov 24, 2016
commit 87fd4a2d79e37a918ddf75a5d79220f23baad099
@@ -189,19 +189,11 @@ impl NetworkHttpRequestFactory {
}
}

trait HttpRequest {
type R: HttpResponse + 'static;

fn send(self, body: &Option<Vec<u8>>) -> Result<Self::R, LoadError>;
}

pub struct WrappedHttpRequest {
request: HyperRequest<Fresh>
}

impl HttpRequest for WrappedHttpRequest {
type R = WrappedHttpResponse;

impl WrappedHttpRequest {
fn send(self, body: &Option<Vec<u8>>) -> Result<WrappedHttpResponse, LoadError> {
let url = ServoUrl::from_url(self.request.url.clone());
let mut request_writer = match self.request.start() {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.