Skip to content

Commit 94ef9ad

Browse files
committed
adopt for_str as only constructor (and rename it for_url)
1 parent 49713a1 commit 94ef9ad

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

src/client.rs

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -126,23 +126,8 @@ impl Client {
126126
///
127127
/// [`ClientBuilder`]: struct.ClientBuilder.html
128128
/// [`.stream()`]: #method.stream
129-
pub fn for_url<U: r::IntoUrl>(url: U) -> Result<ClientBuilder> {
130-
let url = url
131-
.into_url()
132-
.map_err(|e| Error::HttpRequest(Box::new(e)))?;
133-
Ok(ClientBuilder {
134-
url: url,
135-
headers: r::header::HeaderMap::new(),
136-
})
137-
}
138-
139-
/// Construct a new `Client` (via a [`ClientBuilder`]). This will not
140-
/// perform any network activity until [`.stream()`] is called.
141-
///
142-
/// [`ClientBuilder`]: struct.ClientBuilder.html
143-
/// [`.stream()`]: #method.stream
144-
pub fn for_str(str_url: &str) -> Result<ClientBuilder> {
145-
let url = Url::parse(str_url).map_err(|e| Error::HttpRequest(Box::new(e)))?;
129+
pub fn for_url(url: &str) -> Result<ClientBuilder> {
130+
let url = Url::parse(url).map_err(|e| Error::HttpRequest(Box::new(e)))?;
146131
Ok(ClientBuilder {
147132
url: url,
148133
headers: r::header::HeaderMap::new(),

0 commit comments

Comments
 (0)