Skip to content

Commit cf36dbd

Browse files
committed
Change fixed rate to id 1 and retain real time parsing to fixed rate
1 parent c3bba73 commit cf36dbd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lazer/sdk/rust/protocol/src/router.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ impl Serialize for Channel {
182182
mod channel_ids {
183183
use super::ChannelId;
184184

185+
pub const FIXED_RATE_1: ChannelId = ChannelId(1);
185186
pub const FIXED_RATE_50: ChannelId = ChannelId(2);
186187
pub const FIXED_RATE_200: ChannelId = ChannelId(3);
187-
pub const FIXED_RATE_1: ChannelId = ChannelId(4);
188188
}
189189

190190
impl Channel {
@@ -208,7 +208,9 @@ fn id_supports_all_fixed_rates() {
208208
}
209209

210210
fn parse_channel(value: &str) -> Option<Channel> {
211-
if let Some(rest) = value.strip_prefix("fixed_rate@") {
211+
if value == "real_time" {
212+
Some(Channel::FixedRate(FixedRate::MIN))
213+
} else if let Some(rest) = value.strip_prefix("fixed_rate@") {
212214
let ms_value = rest.strip_suffix("ms")?;
213215
Some(Channel::FixedRate(FixedRate::from_ms(
214216
ms_value.parse().ok()?,

0 commit comments

Comments
 (0)