File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ fn main() {
66 // NOTE: This assumes Tor is running localy, with an unauthenticated Socks5 listening at
77 // localhost:9050
88 let proxy = Socks5Config :: new ( "127.0.0.1:9050" ) ;
9- let config = ConfigBuilder :: new ( ) . socks5 ( Some ( proxy) ) . unwrap ( ) . build ( ) ;
9+ let config = ConfigBuilder :: new ( ) . socks5 ( Some ( proxy) ) . build ( ) ;
1010
1111 let client = Client :: from_config ( "tcp://explorernuoc63nb.onion:110" , config. clone ( ) ) . unwrap ( ) ;
1212 let res = client. server_features ( ) ;
Original file line number Diff line number Diff line change @@ -404,10 +404,7 @@ mod tests {
404404 let now = Instant :: now ( ) ;
405405 let client = Client :: from_config (
406406 & endpoint,
407- crate :: config:: ConfigBuilder :: new ( )
408- . timeout ( Some ( 5 ) )
409- . unwrap ( )
410- . build ( ) ,
407+ crate :: config:: ConfigBuilder :: new ( ) . timeout ( Some ( 5 ) ) . build ( ) ,
411408 ) ;
412409 let elapsed = now. elapsed ( ) ;
413410
Original file line number Diff line number Diff line change @@ -44,15 +44,15 @@ impl ConfigBuilder {
4444
4545 /// Set the socks5 config if Some, it accept an `Option` because it's easier for the caller to use
4646 /// in a method chain
47- pub fn socks5 ( mut self , socks5_config : Option < Socks5Config > ) -> Result < Self , Error > {
47+ pub fn socks5 ( mut self , socks5_config : Option < Socks5Config > ) -> Self {
4848 self . config . socks5 = socks5_config;
49- Ok ( self )
49+ self
5050 }
5151
5252 /// Sets the timeout
53- pub fn timeout ( mut self , timeout : Option < u8 > ) -> Result < Self , Error > {
53+ pub fn timeout ( mut self , timeout : Option < u8 > ) -> Self {
5454 self . config . timeout = timeout. map ( |t| Duration :: from_secs ( t as u64 ) ) ;
55- Ok ( self )
55+ self
5656 }
5757
5858 /// Sets the retry attempts number
You can’t perform that action at this time.
0 commit comments