From 6aa5f2536c284b6d0239284a604b77aced1923ed Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 18 Mar 2020 15:42:18 +0100 Subject: [PATCH] library: material: enum: add deserialization --- src/material/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/material/mod.rs b/src/material/mod.rs index 66ef234..3aa6bb7 100644 --- a/src/material/mod.rs +++ b/src/material/mod.rs @@ -1,10 +1,14 @@ use super::core::color::LinearColor; use super::Point2D; +use serde::Deserialize; /// All the existing `Material` implementation. +#[serde(tag = "type")] +#[serde(rename_all = "lowercase")] #[enum_dispatch::enum_dispatch] -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Deserialize)] pub enum MaterialEnum { + #[serde(rename = "uniform")] UniformMaterial, }