diff options
Diffstat (limited to 'src/client/client.rs')
| -rw-r--r-- | src/client/client.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/client/client.rs b/src/client/client.rs index 617b688..37128b3 100644 --- a/src/client/client.rs +++ b/src/client/client.rs @@ -51,7 +51,7 @@ impl<C: Connection> std::fmt::Display for Client<C> { } impl<C: Connection> Client<C> { - pub fn new(connector: C) -> Self { + pub fn new(connector: C) -> Result<Self, C::Err> { let c = Self { ip: connector.get_ip(), connector, @@ -69,9 +69,8 @@ impl<C: Connection> Client<C> { }, env: std::env::vars().collect(), }; - // FIXME: handle this and all unwraps - c.connector.init(&c).unwrap(); - c + c.connector.init(&c)?; + Ok(c) } pub fn enter_loop(mut self) -> ! { |
