diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-05-17 16:45:46 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-05-17 16:45:46 +0200 |
commit | 7fd6ffa17ebc9ab7a6ef1ec424f2be38eea81152 (patch) | |
tree | dbe2168bb3f7863e267157327139ef8a4078d66e | |
parent | 9202b71645f5040ea05f2c913b255f3ebf2e2088 (diff) |
Change WkdUrl's functions to take a reference receiver.
-rw-r--r-- | net/src/wkd.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/src/wkd.rs b/net/src/wkd.rs index 7d0e4b7e..91c4f2a4 100644 --- a/net/src/wkd.rs +++ b/net/src/wkd.rs @@ -82,13 +82,13 @@ impl WkdUrl { } /// Returns an URL string from a WkdUrl. - pub fn to_string<T>(self, direct_method: T) -> Result<String> + pub fn to_string<T>(&self, direct_method: T) -> Result<String> where T: Into<Option<bool>> { let direct_method = direct_method.into().unwrap_or(false); let authority; let path; if direct_method { - authority = self.domain; + authority = self.domain.clone(); path = ".well-known/openpgpkey/hu/".to_string() + &self.local_encoded; } else { @@ -103,7 +103,7 @@ impl WkdUrl { } /// Returns an url::Url. - pub fn to_url<T>(self, direct_method: T) -> Result<Url> + pub fn to_url<T>(&self, direct_method: T) -> Result<Url> where T: Into<Option<bool>> { let url_string = self.to_string(direct_method)?; let url = Url::parse(url_string.as_str())?; @@ -111,7 +111,7 @@ impl WkdUrl { } /// Returns an hyper::Uri. - pub fn to_uri<T>(self, direct_method: T) -> Result<Uri> + pub fn to_uri<T>(&self, direct_method: T) -> Result<Uri> where T: Into<Option<bool>> { // let url = self.to_url(direct_method)?; let url_string = self.to_string(direct_method)?; |