Skip to content

Commit

Permalink
feat(client): implement Default trait for client
Browse files Browse the repository at this point in the history
Initial implementation of the default trait.
  • Loading branch information
winding-lines committed May 16, 2015
1 parent e9dcf45 commit be041d9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ fn with_connector<C: NetworkConnector<Stream=S> + Send + 'static, S: NetworkStre
Connector(Box::new(ConnAdapter(c)))
}

impl Default for Client {
fn default() -> Client { Client::new() }
}

struct ConnAdapter<C: NetworkConnector + Send>(C);

impl<C: NetworkConnector<Stream=S> + Send, S: NetworkStream + Send> NetworkConnector for ConnAdapter<C> {
Expand Down Expand Up @@ -372,7 +376,7 @@ pub enum RedirectPolicy {
FollowIf(fn(&Url) -> bool),
}

// This is a hack because of upstream typesystem issues.
// This is a hack because of upstream typesystem issues.
impl Clone for RedirectPolicy {
fn clone(&self) -> RedirectPolicy {
*self
Expand Down

0 comments on commit be041d9

Please sign in to comment.