aboutsummaryrefslogtreecommitdiff
path: root/src/primitive/msgid.rs
diff options
context:
space:
mode:
authorTobias Deiminger <tdmg@linutronix.de>2024-04-15 18:14:14 +0200
committerMax Audron <audron@cocaine.farm>2025-02-25 00:09:27 +0100
commit834dcc6319d3fbb9b0ed92a6b27b251ceb6127d7 (patch)
treeeb084373e73a138e86742f9118e473c1167501e6 /src/primitive/msgid.rs
parentAdd MsgId as Rust type (diff)
Use MsgId in Variant
Diffstat (limited to 'src/primitive/msgid.rs')
-rw-r--r--src/primitive/msgid.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/primitive/msgid.rs b/src/primitive/msgid.rs
index 509c1e7..a8048cf 100644
--- a/src/primitive/msgid.rs
+++ b/src/primitive/msgid.rs
@@ -4,19 +4,17 @@ pub struct MsgId(
#[cfg(feature = "long-message-id")] pub i64,
);
-use failure::Error;
-
-use crate::primitive::signedint;
+use crate::error::ProtocolError;
use crate::{deserialize::*, serialize::*};
impl Serialize for MsgId {
- fn serialize(&self) -> Result<Vec<u8>, Error> {
+ fn serialize(&self) -> Result<Vec<u8>, ProtocolError> {
self.0.serialize()
}
}
impl Deserialize for MsgId {
- fn parse(b: &[u8]) -> Result<(usize, Self), Error> {
+ fn parse(b: &[u8]) -> Result<(usize, Self), ProtocolError> {
#[cfg(not(feature = "long-message-id"))]
let (size, value) = i32::parse(b)?;
#[cfg(feature = "long-message-id")]