replace try! with ? syntax

This commit is contained in:
Astro 2018-08-02 20:10:26 +02:00
commit b82237f422
4 changed files with 8 additions and 12 deletions

View file

@ -45,7 +45,7 @@ impl Client {
/// Start polling the returned instance so that it will connect
/// and yield events.
pub fn new(jid: &str, password: &str, handle: Handle) -> Result<Self, JidParseError> {
let jid = try!(Jid::from_str(jid));
let jid = Jid::from_str(jid)?;
let password = password.to_owned();
let connect = Self::make_connect(jid.clone(), password.clone(), handle);
Ok(Client {