Skip to content

Commit e5f8014

Browse files
authored
Remove deprecated field inside GatewayEvent::Heartbeat (#3115)
1 parent 09bea56 commit e5f8014

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/gateway/sharding/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ impl Shard {
458458
}) => self
459459
.handle_gateway_dispatch(seq, data, &original_str)
460460
.map(|e| Some(ShardAction::Dispatch(e))),
461-
Ok(GatewayEvent::Heartbeat(..)) => {
461+
Ok(GatewayEvent::Heartbeat) => {
462462
info!("[{:?}] Received shard heartbeat", self.shard_info);
463463

464464
Ok(Some(ShardAction::Heartbeat))

src/model/event.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ pub enum GatewayEvent {
937937
// Used for debugging, if the data cannot be deserialised.
938938
original_str: FixedString,
939939
},
940-
Heartbeat(#[deprecated = "always 0 because it is never provided by the gateway"] u64),
940+
Heartbeat,
941941
Reconnect,
942942
/// Whether the session can be resumed.
943943
InvalidateSession(bool),
@@ -959,11 +959,7 @@ impl<'de> Deserialize<'de> for GatewayEvent {
959959
data: map,
960960
}
961961
},
962-
Opcode::Heartbeat => {
963-
// Placeholder value. Discord expects the last Dispatch
964-
// sequence number and doesn't send it with the heartbeat.
965-
Self::Heartbeat(0)
966-
},
962+
Opcode::Heartbeat => Self::Heartbeat,
967963
Opcode::InvalidSession => Self::InvalidateSession(remove_from_map(&mut map, "d")?),
968964
Opcode::Hello => {
969965
#[derive(Deserialize)]

0 commit comments

Comments
 (0)