From f30015ad06133270759779d2e1263a1147429086 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 1 Dec 2021 13:23:23 +0100 Subject: [PATCH] Inline trivial single-use function --- epp-client/src/connection/registry.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/epp-client/src/connection/registry.rs b/epp-client/src/connection/registry.rs index fd9e7ff..db3e3cc 100644 --- a/epp-client/src/connection/registry.rs +++ b/epp-client/src/connection/registry.rs @@ -38,15 +38,6 @@ impl EppConnection { }) } - /// Writes to the socket - async fn write(&mut self, buf: &[u8]) -> Result<(), Box> { - let wrote = self.stream.write(buf).await?; - - debug!("{}: Wrote {} bytes", self.registry, wrote); - - Ok(()) - } - /// Constructs an EPP XML request in the required form and sends it to the server async fn send_epp_request(&mut self, content: &str) -> Result<(), Box> { let len = content.len(); @@ -60,7 +51,9 @@ impl EppConnection { buf[..4].clone_from_slice(&len_u32); buf[4..].clone_from_slice(content.as_bytes()); - self.write(&buf).await + let wrote = self.stream.write(&buf).await?; + debug!("{}: Wrote {} bytes", self.registry, wrote); + Ok(()) } /// Reads response from the socket