Skip to content

Commit

Permalink
feat: Derive PartialEq for some structs
Browse files Browse the repository at this point in the history
- CoapRequest
- CoapResponse
- Packet
- Header

Closes #41.
  • Loading branch information
martindisch committed Jul 31, 2024
1 parent cf15358 commit 3ca88e7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ pub enum MessageType {
}

/// The message header.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq)]
pub struct Header {
ver_type_tkl: u8,
pub code: MessageClass,
Expand Down
2 changes: 1 addition & 1 deletion src/packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ impl From<ObserveOption> for usize {
}

/// The CoAP packet.
#[derive(Debug, Clone, Default)]
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Packet {
pub header: Header,
token: Vec<u8>,
Expand Down
2 changes: 1 addition & 1 deletion src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
};

/// The CoAP request.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq)]
pub struct CoapRequest<Endpoint> {
pub message: Packet,
pub response: Option<CoapResponse>,
Expand Down
2 changes: 1 addition & 1 deletion src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{
};

/// The CoAP response.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq)]
pub struct CoapResponse {
pub message: Packet,
}
Expand Down

0 comments on commit 3ca88e7

Please sign in to comment.