-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct UserEntity {
#[serde(flatten)]
inner: User,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct User {
pub id: RecordId,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RecordId(Thing);
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Thing {
/// Table name
pub tb: String,
pub id: Id,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum Id {
A { a: bool },
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct UserData {
pub name: String,
}
#[cfg(test)]
mod tests {
use crate::{Id, Point, User, UserEntity};
use serde_content::{Deserializer, Serializer};
#[test]
fn bug() {
let point = UserEntity {
inner: User {
id: crate::RecordId(crate::Thing {
tb: "todo!(),".to_owned(),
id: Id::A { a: true },
}),
},
};
let serialized = Serializer::new().serialize(&point).unwrap();
let deserialized: UserEntity = Deserializer::new(serialized).deserialize().unwrap();
}
}
nicolube, mateodelnorte and nacardin
Metadata
Metadata
Assignees
Labels
No labels