bevy/crates/bevy_ecs/hecs/src/serde.rs

14 lines
289 B
Rust
Raw Normal View History

2020-07-10 04:18:35 +00:00
// modified by Bevy contributors
use crate::entities::Entity;
use serde::{Serialize, Serializer};
impl Serialize for Entity {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
serializer.serialize_u32(self.id())
}
}