Skip to content

Commit

Permalink
Remove unneeded interest_id field
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierHecart committed Apr 5, 2024
1 parent 52ff7d0 commit 8c9abc1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
4 changes: 0 additions & 4 deletions commons/zenoh-codec/src/network/declare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,6 @@ where

fn write(self, writer: &mut W, x: &interest::DeclareInterest) -> Self::Output {
let interest::DeclareInterest {
id,
interest: _,
wire_expr,
} = x;
Expand All @@ -977,7 +976,6 @@ where
self.write(&mut *writer, header)?;

// Body
self.write(&mut *writer, id)?;
self.write(&mut *writer, x.options())?;
if let Some(we) = wire_expr.as_ref() {
self.write(&mut *writer, we)?;
Expand Down Expand Up @@ -1012,7 +1010,6 @@ where
}

// Body
let id: interest::InterestId = self.codec.read(&mut *reader)?;
let options: u8 = self.codec.read(&mut *reader)?;
let interest = Interest::from(options);

Expand All @@ -1035,7 +1032,6 @@ where
}

Ok(interest::DeclareInterest {
id,
interest,
wire_expr,
})
Expand Down
5 changes: 0 additions & 5 deletions commons/zenoh-protocol/src/network/declare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -806,8 +806,6 @@ pub mod interest {
/// +-+-+-+-+-+-+-+-+
/// |Z|X|X| D_INT |
/// +---------------+
/// ~ intst_id:z32 ~
/// +---------------+
/// |A|M|N|R|T|Q|S|K| (*)
/// +---------------+
/// ~ key_scope:z16 ~ if R==1
Expand All @@ -829,7 +827,6 @@ pub mod interest {
/// ```
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct DeclareInterest {
pub id: InterestId,
pub interest: Interest,
pub wire_expr: Option<WireExpr<'static>>,
}
Expand All @@ -854,12 +851,10 @@ pub mod interest {
use rand::Rng;
let mut rng = rand::thread_rng();

let id: InterestId = rng.gen();
let wire_expr = rng.gen_bool(0.5).then_some(WireExpr::rand());
let interest = Interest::rand();

Self {
id,
wire_expr,
interest,
}
Expand Down

0 comments on commit 8c9abc1

Please sign in to comment.