Skip to content

Commit

Permalink
fix: docs, warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cakekindel committed Jan 29, 2023
1 parent 25d37a0 commit 5a84560
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 2 additions & 0 deletions toad-msg/src/msg/id.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#[allow(unused_imports)]
use crate::Token;
use toad_common::Cursor;

use super::MessageParseError;
Expand Down
4 changes: 3 additions & 1 deletion toad-msg/src/msg/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#[allow(unused_imports)]
use crate::TryIntoBytes;
use toad_common::{AppendCopy, Array, Cursor, GetSize};
use toad_macros::rfc_7252_doc;

Expand Down Expand Up @@ -249,7 +251,7 @@ impl<PayloadBytes: Array<Item = u8> + AppendCopy<u8>, Options: OptionMap>

/// Get the value(s) of an option by number
///
/// This just invokes [`Map::get`] on [`Message.opts`].
/// This just invokes [`toad_common::Map::get`] on [`Message.opts`].
pub fn get(&self, n: OptNumber) -> Option<&Options::OptValues> {
self.opts.get(&n)
}
Expand Down
2 changes: 1 addition & 1 deletion toad-msg/src/msg/opt/known.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Content-Format
/// Content-Format values
pub mod content_format;

macro_rules! opt {
Expand Down
8 changes: 4 additions & 4 deletions toad-msg/src/msg/opt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub use parse_error::*;
pub mod known;
pub use known::*;

/// Implementor of [`IterOpts`]
/// An iterator over owned [`Opt`]s
#[derive(Debug, Clone)]
pub struct OptIter<M, I>
where M: OptionMap
Expand All @@ -29,7 +29,7 @@ pub struct OptIter<M, I>
__p: PhantomData<M>,
}

/// Implementor of [`IterOptRefs`]
/// An iterator over [`OptRef`]s
#[derive(Debug, Clone)]
pub struct OptRefIter<'a, M, I>
where M: OptionMap
Expand Down Expand Up @@ -369,14 +369,14 @@ pub enum WhenOptionUnsupportedByProxy {
#[doc = rfc_7252_doc!("5.4.2")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
pub enum WhenOptionChanges {
/// If this option is [safe to forward](`ProxySafe::ForwardWhenUnknown`),
/// If this option is [safe to forward](`WhenOptionUnsupportedByProxy::Forward`),
/// but unknown to a proxy, it should be included in the proxy's
/// cache key for this message.
///
/// Corresponds to the option being not "NoCacheKey"
/// in strict CoAP terms
ResponseChanges,
/// If this option is [safe to forward](`ProxySafe::ForwardWhenUnknown`),
/// If this option is [safe to forward](`WhenOptionUnsupportedByProxy::Forward`),
/// but unknown to a proxy, it should not be included in the proxy's
/// cache key for this message, and different values for this option
/// should yield the cached response.
Expand Down
3 changes: 3 additions & 0 deletions toad-msg/src/msg/parse_error.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#[allow(unused_imports)]
use crate::Type;

/// Errors encounterable while parsing a message from bytes
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord)]
pub enum MessageParseError {
Expand Down

0 comments on commit 5a84560

Please sign in to comment.