Skip to content

Commit

Permalink
model: Serialize using type of inner concrete model
Browse files Browse the repository at this point in the history
  • Loading branch information
kirushyk committed Mar 30, 2021
1 parent 743d347 commit 78d2cdf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/models/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl Serialize for Model {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut model = serializer.serialize_struct("Model", 2)?;
model.serialize_field("id", &self.id)?;
model.serialize_field("type", self.get_type())?;
model.serialize_field("type", self.inner.borrow().get_type())?;
model.end()
}
}
Expand Down Expand Up @@ -137,7 +137,7 @@ impl AsModel for Model {
// #[enum_dispatch]
pub trait AsModel {
fn get_type(&self) -> &'static str {
"model"
""
}
fn status(&self) -> String;
fn events_ext(
Expand Down

0 comments on commit 78d2cdf

Please sign in to comment.