Skip to content

Commit

Permalink
fix(coap): Address lints
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed Oct 29, 2024
1 parent 917e1da commit b3f94c9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/riot-rs-coap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
// Moving work from https://github.com/embassy-rs/embassy/pull/2519 in here for the time being
mod udp_nal;

use coap_handler_implementations::{HandlerBuilder, ReportingHandlerBuilder};
use coap_handler_implementations::ReportingHandlerBuilder;
use coapcore::seccontext;
use critical_section::Mutex;
use embassy_net::udp::{PacketMetadata, UdpSocket};
use riot_rs_debug::log::*;
use static_cell::StaticCell;
Expand Down Expand Up @@ -46,7 +45,6 @@ pub async fn coap_run(
&mut tx_meta,
&mut tx_buffer,
);
use embedded_nal_async::UnconnectedUdp;

info!("Starting up CoAP server");

Expand Down
12 changes: 12 additions & 0 deletions src/riot-rs-coap/src/udp_nal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ mod util;
pub use util::Error;
use util::{is_unspec_ip, sockaddr_nal2smol, sockaddr_smol2nal};

#[expect(
dead_code,
reason = "pub item is being prepared for embedded-nal-async where it will be reachable publicly"
)]
pub struct ConnectedUdp<'a> {
remote: IpEndpoint,
// The local port is stored in the socket, as it gets bound. This value is populated lazily:
Expand All @@ -50,6 +54,10 @@ impl<'a> ConnectedUdp<'a> {
///
/// The `socket` must be open (in the sense of smoltcp's `.is_open()`) -- unbound and
/// unconnected.
#[expect(
dead_code,
reason = "pub item is being prepared for embedded-nal-async where it will be reachable publicly"
)]
pub async fn connect_from(
mut socket: udp::UdpSocket<'a>,
local: nal::SocketAddr,
Expand All @@ -74,6 +82,10 @@ impl<'a> ConnectedUdp<'a> {
///
/// The `socket` must be open (in the sense of smoltcp's `.is_open()`) -- unbound and
/// unconnected.
#[expect(
dead_code,
reason = "pub item is being prepared for embedded-nal-async where it will be reachable publicly"
)]
pub async fn connect(socket: udp::UdpSocket<'a>, /*, ... */) -> Result<Self, udp::BindError> {
// This is really just a copy of the provided `embedded_nal::udp::UdpStack::connect` method
todo!("use {:p}", &socket)
Expand Down
1 change: 1 addition & 0 deletions src/riot-rs-coap/src/udp_nal/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pub enum Error {
BindError(udp::BindError),
/// Error stemming from failure to represent the given address family for lack of enabled
/// embassy-net features
#[expect(dead_code, reason = "feature selection currently disabled")]
AddressFamilyUnavailable,
}

Expand Down

0 comments on commit b3f94c9

Please sign in to comment.