Skip to content

Commit

Permalink
perf(model): Remove sequence from GatewayEventVisitor (#2307)
Browse files Browse the repository at this point in the history
This field was never used or exposed and `cargo check/doc` on recent
nightlies started complaining about it. It is however exposed on the
`GatewayEvent` parser so it cannot be removed there and shouldn't.

Signed-off-by: Jens Reidel <[email protected]>
  • Loading branch information
Gelbpunkt authored Jan 13, 2024
1 parent 29d2133 commit cb6d47d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions twilight-model/src/gateway/event/gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ impl<'a> GatewayEventDeserializer<'a> {
}
}

struct GatewayEventVisitor<'a>(u8, Option<u64>, Option<Cow<'a, str>>);
struct GatewayEventVisitor<'a>(u8, Option<Cow<'a, str>>);

impl GatewayEventVisitor<'_> {
fn field<'de, T: Deserialize<'de>, V: MapAccess<'de>>(
Expand Down Expand Up @@ -252,7 +252,7 @@ impl<'de> Visitor<'de> for GatewayEventVisitor<'_> {
Ok(match op {
OpCode::Dispatch => {
let t = self
.2
.1
.ok_or_else(|| DeError::custom("event type not provided beforehand"))?;

let mut d = None;
Expand Down Expand Up @@ -355,7 +355,7 @@ impl<'de> DeserializeSeed<'de> for GatewayEventDeserializer<'_> {
deserializer.deserialize_struct(
"GatewayEvent",
FIELDS,
GatewayEventVisitor(self.op, self.sequence, self.event_type),
GatewayEventVisitor(self.op, self.event_type),
)
}
}
Expand Down

0 comments on commit cb6d47d

Please sign in to comment.