From 6c4a849e4e7a2cf28076d2d6a7476e0c3a31374c Mon Sep 17 00:00:00 2001 From: Antonio de Luna Date: Fri, 9 Oct 2015 01:35:03 -0700 Subject: [PATCH] removed &mut and clone --- tests/unit/net/http_loader.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/unit/net/http_loader.rs b/tests/unit/net/http_loader.rs index 883db09c3e8..67d858fe023 100644 --- a/tests/unit/net/http_loader.rs +++ b/tests/unit/net/http_loader.rs @@ -28,15 +28,15 @@ use url::Url; const DEFAULT_USER_AGENT: &'static str = "Test-agent"; fn respond_with(body: Vec) -> MockResponse { - let mut headers = Headers::new(); - respond_with_headers(body, &mut headers) + let headers = Headers::new(); + respond_with_headers(body, headers) } -fn respond_with_headers(body: Vec, headers: &mut Headers) -> MockResponse { +fn respond_with_headers(body: Vec, mut headers: Headers) -> MockResponse { headers.set(ContentLength(body.len() as u64)); MockResponse::new( - headers.clone(), + headers, StatusCode::Ok, RawStatus(200, Cow::Borrowed("Ok")), body @@ -118,8 +118,8 @@ fn response_for_request_type(t: ResponseType) -> Result ResponseType::Text(b) => { Ok(respond_with(b)) }, - ResponseType::WithHeaders(b, mut h) => { - Ok(respond_with_headers(b, &mut h)) + ResponseType::WithHeaders(b, h) => { + Ok(respond_with_headers(b, h)) } } }