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() {
6
6
// NOTE: This assumes Tor is running localy, with an unauthenticated Socks5 listening at
7
7
// localhost:9050
8
8
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 ( ) ;
10
10
11
11
let client = Client :: from_config ( "tcp://explorernuoc63nb.onion:110" , config. clone ( ) ) . unwrap ( ) ;
12
12
let res = client. server_features ( ) ;
Original file line number Diff line number Diff line change @@ -404,10 +404,7 @@ mod tests {
404
404
let now = Instant :: now ( ) ;
405
405
let client = Client :: from_config (
406
406
& endpoint,
407
- crate :: config:: ConfigBuilder :: new ( )
408
- . timeout ( Some ( 5 ) )
409
- . unwrap ( )
410
- . build ( ) ,
407
+ crate :: config:: ConfigBuilder :: new ( ) . timeout ( Some ( 5 ) ) . build ( ) ,
411
408
) ;
412
409
let elapsed = now. elapsed ( ) ;
413
410
Original file line number Diff line number Diff line change @@ -44,15 +44,15 @@ impl ConfigBuilder {
44
44
45
45
/// Set the socks5 config if Some, it accept an `Option` because it's easier for the caller to use
46
46
/// 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 {
48
48
self . config . socks5 = socks5_config;
49
- Ok ( self )
49
+ self
50
50
}
51
51
52
52
/// 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 {
54
54
self . config . timeout = timeout. map ( |t| Duration :: from_secs ( t as u64 ) ) ;
55
- Ok ( self )
55
+ self
56
56
}
57
57
58
58
/// Sets the retry attempts number
You can’t perform that action at this time.
0 commit comments