Przeglądaj źródła

Add ? operator for Display for HostAndPort

Tomasz 9 lat temu
rodzic
commit
cf77f2d94b
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      src/host.rs

+ 2 - 2
src/host.rs

@@ -194,8 +194,8 @@ impl<'a> HostAndPort<&'a str> {
 
 impl<S: AsRef<str>> fmt::Display for HostAndPort<S> {
     fn fmt(&self, f: &mut Formatter) -> fmt::Result {
-        try!(self.host.fmt(f));
-        try!(f.write_str(":"));
+        self.host.fmt(f)?;
+        f.write_str(":")?;
         self.port.fmt(f)
     }
 }