Remove extra clone when request with Url

This commit is contained in:
Berrysoft authored and Martin Algesten committed 2021-05-11 20:18:34 +02:00
1 parent 39d44af669
commit c06c345f28
2 files changed
+1 -9

No files matched your search

+1 -1
View File
@@ -141,7 +141,7 @@ impl Agent {
/// # }
/// ```
pub fn request_url(&self, method: &str, url: &Url) -> Request {
Request::with_url(self.clone(), method.into(), url.clone())
Request::new(self.clone(), method.into(), url.to_string())
}
/// Make a GET request from this agent.
-8
View File
@@ -47,14 +47,6 @@ impl fmt::Debug for Request {
impl Request {
pub(crate) fn new(agent: Agent, method: String, url: String) -> Request {
Self::_new(agent, method, url)
}
pub(crate) fn with_url(agent: Agent, method: String, url: Url) -> Request {
Self::_new(agent, method, url.to_string())
}
fn _new(agent: Agent, method: String, url: String) -> Request {
Request {
agent,
method,