Skip to content

Commit

Permalink
fix: resolve event serialization issues
Browse files Browse the repository at this point in the history
  • Loading branch information
vyfor committed Dec 13, 2024
1 parent 5097ceb commit 7ec693e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/messages/events/server/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ impl Serialize for LogEvent {
state: &mut crate::protocol::msgpack::SerializeState,
) -> crate::Result<()> {
let mut data = HashMap::new();
data.insert("message", ValueRef::String(&self.message));
data.insert("message", ValueRef::Str(&self.message));
data.insert("level", ValueRef::UInteger(self.level as u64));

f("type", ValueRef::String("log"), state)?;
f("type", ValueRef::Str("log"), state)?;
f("data", ValueRef::Map(data), state)?;

Ok(())
Expand Down
3 changes: 2 additions & 1 deletion src/messages/events/server/ready.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ impl Serialize for ReadyEvent {
f: crate::protocol::msgpack::SerializeFn<'a>,
state: &mut crate::protocol::msgpack::SerializeState,
) -> crate::Result<()> {
f("type", ValueRef::String("ready"), state)?;
f("type", ValueRef::Str("ready"), state)?;
f("data", ValueRef::Nil, state)?;

Ok(())
}
Expand Down

0 comments on commit 7ec693e

Please sign in to comment.