Skip to content

Commit 005467d

Browse files
committed
docs: a couple of docs improvements
1 parent 79c6643 commit 005467d

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

stun-types/src/attribute/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
//! }
6262
//! impl<'a> From<&MyAttribute> for RawAttribute<'a> {
6363
//! fn from(value: &MyAttribute) -> RawAttribute<'a> {
64-
//! let mut ret = vec![0; 4];
64+
//! let mut ret = [0; 4];
6565
//! BigEndian::write_u32(&mut ret, value.value);
6666
//! RawAttribute::new(MyAttribute::TYPE, &ret).into_owned()
6767
//! }

stun-types/src/data.rs

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
// option. This file may not be copied, modified, or distributed
77
// except according to those terms.
88

9+
//! Data handling
10+
//!
11+
//! Provides a CoW interface for slices of `[u8]` and `Box<[u8]>`
12+
913
/// A slice of data
1014
#[derive(Debug, Clone, PartialEq, Eq)]
1115
#[repr(transparent)]

stun-types/src/message.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
//! 0x00, 0x00, 0x00, 0x00, // \
3131
//! 0x00, 0x00, 0x00, 0x00, // } transaction ID
3232
//! 0x00, 0x00, 0x73, 0x92, // /
33-
//! 0x00, 0x1D, 0x00, 0x04, // PasswordAlgorithm ttribute
34-
//! 0x00, 0x02, 0x00, 0x00 // PasswordAlgorithm attribute
33+
//! 0x00, 0x1D, 0x00, 0x04, // PasswordAlgorithm attribute header (type and length)
34+
//! 0x00, 0x02, 0x00, 0x00 // PasswordAlgorithm attribute value
3535
//! ];
3636
//! let msg = Message::from_bytes(&msg_data).unwrap();
3737
//!
@@ -84,7 +84,7 @@ use crate::attribute::*;
8484

8585
use tracing::{debug, warn};
8686

87-
/// The value of magic cookie (in network byte order) as specified in RFC5389, and RFC8489.
87+
/// The value of the magic cookie (in network byte order) as specified in RFC5389, and RFC8489.
8888
pub const MAGIC_COOKIE: u32 = 0x2112A442;
8989

9090
/// The value of the binding message type. Can be used in either a request or an indication
@@ -1331,6 +1331,7 @@ impl<'a> Iterator for MessageAttributesIter<'a> {
13311331
}
13321332
}
13331333

1334+
/// A builder of a STUN Message to a sequence of bytes.
13341335
#[derive(Clone, Debug)]
13351336
pub struct MessageBuilder<'a> {
13361337
msg_type: MessageType,

0 commit comments

Comments
 (0)