refactor(proto): Remove Clock::None and default to Clock::Both

Simplify clock parameter negotiation by rejecting the ambiguous 'None' value.
This commit is contained in:
Nils Andreas Svee committed 2026-04-28 16:15:26 +07:00
1 parent 82491f0f61
commit eade39aa94
2 files changed
+27 -4

No files matched your search

+11 -1
View File
@@ -139,7 +139,7 @@ mod tests {
assert_eq!(
echo_header_len(
false,
&params(ReceivedStats::None, StampAt::None, Clock::None)
&params(ReceivedStats::None, StampAt::None, Clock::Both)
),
16
);
@@ -180,6 +180,16 @@ mod tests {
);
}
#[test]
fn no_timestamp_layout_ignores_clock() {
for clock in [Clock::Wall, Clock::Monotonic, Clock::Both] {
assert_eq!(
echo_header_len(false, &params(ReceivedStats::None, StampAt::None, clock)),
16
);
}
}
#[test]
fn negotiated_length_never_smaller_than_header() {
let mut p = params(ReceivedStats::Both, StampAt::Both, Clock::Both);