Use Vec instead of BytesMut
There doesn't seem to be any particular advantage to using BytesMut here.
This commit is contained in:
parent
f30015ad06
commit
59151df029
|
@ -11,7 +11,6 @@ repository = "https://github.com/masalachai/epp-client"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
epp-client-macros = { version = "0.1", path = "../epp-client-macros" }
|
epp-client-macros = { version = "0.1", path = "../epp-client-macros" }
|
||||||
bytes = "1"
|
|
||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
env_logger = "0.9"
|
env_logger = "0.9"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
//! Manages registry connections and reading/writing to them
|
//! Manages registry connections and reading/writing to them
|
||||||
|
|
||||||
use bytes::BytesMut;
|
|
||||||
use rustls::{OwnedTrustAnchor, RootCertStore};
|
use rustls::{OwnedTrustAnchor, RootCertStore};
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
@ -66,7 +65,7 @@ impl EppConnection {
|
||||||
let message_size = buf_size - 4;
|
let message_size = buf_size - 4;
|
||||||
debug!("{}: Response buffer size: {}", self.registry, message_size);
|
debug!("{}: Response buffer size: {}", self.registry, message_size);
|
||||||
|
|
||||||
let mut buf = BytesMut::with_capacity(4096);
|
let mut buf = Vec::with_capacity(4096);
|
||||||
let mut read_buf = vec![0u8; 4096];
|
let mut read_buf = vec![0u8; 4096];
|
||||||
|
|
||||||
let mut read_size: usize = 0;
|
let mut read_size: usize = 0;
|
||||||
|
@ -86,9 +85,7 @@ impl EppConnection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let data = buf.to_vec();
|
Ok(buf)
|
||||||
|
|
||||||
Ok(data)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Receives response from the socket and converts it into an EPP XML string
|
/// Receives response from the socket and converts it into an EPP XML string
|
||||||
|
|
Loading…
Reference in New Issue