Skip to content

Commit 8e246c3

Browse files
authored
Doc: fix SeqNum and SeqNumGenerator documentation (fix #1949) (#1952)
1 parent 8f18ee4 commit 8e246c3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

io/zenoh-transport/src/common/seq_num.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ impl SeqNum {
5757
/// - 16_386 (i.e., 2^14)
5858
/// - 2_097_152 (i.e., 2^21)
5959
///
60-
/// This function will panic if `value` is out of bound w.r.t. `resolution`. That is if
60+
/// # Errors
61+
///
62+
/// This function will return an error if `value` is out of bound w.r.t. `resolution`. That is if
6163
/// `value` is greater or equal than `resolution`.
6264
///
6365
pub(crate) fn make(value: TransportSn, resolution: Bits) -> ZResult<SeqNum> {
@@ -179,8 +181,10 @@ impl SeqNumGenerator {
179181
/// As a consequence of wire zenoh's representation of sequence numbers
180182
/// this should be a multiple of 7.
181183
///
182-
/// This function will panic if `value` is out of bound w.r.t. `resolution`. That is if
183-
/// `value` is greater or equal than `resolution`.
184+
/// # Errors
185+
///
186+
/// This function will return an error if `initial_sn` is out of bound w.r.t. `resolution`. That is if
187+
/// `initial_sn` is greater or equal than `resolution`.
184188
///
185189
pub(crate) fn make(initial_sn: TransportSn, resolution: Bits) -> ZResult<SeqNumGenerator> {
186190
let sn = SeqNum::make(initial_sn, resolution)?;

0 commit comments

Comments
 (0)