aboutsummaryrefslogtreecommitdiff
path: root/src/util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/util.rs b/src/util.rs
index e81a89c..f860672 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -2,9 +2,9 @@ use std::net::SocketAddr;
use std::net::ToSocketAddrs;
use std::pin::Pin;
+use bytes::Bytes;
use log::info;
use serde::Serialize;
-use bytes::Bytes;
use futures::Stream;
use tokio::sync::watch;
@@ -35,19 +35,16 @@ pub type Packet = Result<Bytes, u8>;
///
/// Field names and variant names are included in the serialization.
/// This is used internally by the netapp communication protocol.
-pub fn rmp_to_vec_all_named<T>(
- val: &T,
-) -> Result<(Vec<u8>, Option<ByteStream>), rmp_serde::encode::Error>
+pub fn rmp_to_vec_all_named<T>(val: &T) -> Result<Vec<u8>, rmp_serde::encode::Error>
where
- T: SerializeMessage + ?Sized,
+ T: Serialize + ?Sized,
{
let mut wr = Vec::with_capacity(128);
let mut se = rmp_serde::Serializer::new(&mut wr)
.with_struct_map()
.with_string_variants();
- let (val, stream) = val.serialize_msg();
val.serialize(&mut se)?;
- Ok((wr, stream))
+ Ok(wr)
}
/// This async function returns only when a true signal was received