Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Commit

Permalink
fix: set deserialize on enums as well
Browse files Browse the repository at this point in the history
  • Loading branch information
kjuulh committed Feb 24, 2023
1 parent 3e8ca8d commit e578b0e
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 60 deletions.
3 changes: 2 additions & 1 deletion crates/dagger-codegen/src/rust/templates/enum_tmpl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ fn render_enum_values(values: &FullType) -> Option<rust::Tokens> {

pub fn render_enum(t: &FullType) -> eyre::Result<rust::Tokens> {
let serialize = rust::import("serde", "Serialize");
let deserialize = rust::import("serde", "Deserialize");

Ok(quote! {
#[derive($serialize, Clone, PartialEq, Debug)]
#[derive($serialize, $deserialize, Clone, PartialEq, Debug)]
pub enum $(t.name.as_ref()) {
$(render_enum_values(t))
}
Expand Down
Loading

0 comments on commit e578b0e

Please sign in to comment.