Skip to content

Commit

Permalink
gcoap: Allow upgrading MinimalWritableMessage to MutableWritableMessage
Browse files Browse the repository at this point in the history
Merges: #114
  • Loading branch information
chrysn authored Aug 28, 2024
2 parents 03bd877 + efce845 commit 337397d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ coap-numbers = "^0.2.0"

embedded-graphics = "0.6"

coap-message-0-3 = { package = "coap-message", version = "^0.3.0" }
coap-message-0-3 = { package = "coap-message", version = "^0.3.3" }
coap-handler-0-2 = { package = "coap-handler", version = "^0.2.0" }
embedded-nal = { version = "0.6.0", optional = true }
embedded-nal-tcpextensions = { version = "0.1", optional = true }
Expand Down
6 changes: 6 additions & 0 deletions src/coap_message/impl_0_3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ impl<'a> MinimalWritableMessage for super::ResponseMessage<'a> {
self.payload_mut_with_len(data.len())?.copy_from_slice(data);
Ok(())
}

#[inline]
#[allow(refining_impl_trait_reachable)]
fn promote_to_mutable_writable_message(&mut self) -> Option<&mut Self> {
Some(self)
}
}

impl<'a> MutableWritableMessage for super::ResponseMessage<'a> {
Expand Down

0 comments on commit 337397d

Please sign in to comment.