Skip to content

Commit cd30149

Browse files
committed
cargo fmt
1 parent 1286223 commit cd30149

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/conn/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,11 @@ impl Conn {
395395
}
396396

397397
fn read_packet(&mut self) -> Result<Vec<u8>> {
398-
let data = self.stream_mut().next().transpose()?.ok_or_else(|| io::Error::new(
399-
io::ErrorKind::BrokenPipe,
400-
"server disconnected",
401-
))?;
398+
let data = self
399+
.stream_mut()
400+
.next()
401+
.transpose()?
402+
.ok_or_else(|| io::Error::new(io::ErrorKind::BrokenPipe, "server disconnected"))?;
402403
match data[0] {
403404
0xff => {
404405
let error_packet = parse_err_packet(&*data, self.0.capability_flags)?;

src/conn/opts.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,11 @@ impl OptsBuilder {
466466
///
467467
/// **Note:** IPv6 addresses must be given in square brackets, e.g. `[::1]`.
468468
pub fn ip_or_hostname<T: Into<String>>(mut self, ip_or_hostname: Option<T>) -> Self {
469-
let new = ip_or_hostname.map(Into::into).unwrap_or_else(|| "127.0.0.1".into());
470-
self.opts.0.ip_or_hostname = url::Host::parse(&new)
471-
.unwrap_or_else(|_| url::Host::Domain(new.to_owned()));
469+
let new = ip_or_hostname
470+
.map(Into::into)
471+
.unwrap_or_else(|| "127.0.0.1".into());
472+
self.opts.0.ip_or_hostname =
473+
url::Host::parse(&new).unwrap_or_else(|_| url::Host::Domain(new.to_owned()));
472474
self
473475
}
474476

0 commit comments

Comments
 (0)