From 09a07369eb7d958084517607325eb155b01eb1fd Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Fri, 13 Jan 2023 14:36:48 +0800 Subject: [PATCH] Add missing Debug and Default traits --- butane_core/src/fkey.rs | 1 + butane_core/src/many.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/butane_core/src/fkey.rs b/butane_core/src/fkey.rs index 834e12a8..9f22c488 100644 --- a/butane_core/src/fkey.rs +++ b/butane_core/src/fkey.rs @@ -21,6 +21,7 @@ use std::fmt::{Debug, Formatter}; /// ... /// } /// +#[derive(Default)] pub struct ForeignKey where T: DataObject, diff --git a/butane_core/src/many.rs b/butane_core/src/many.rs index c6969f69..e27cc7a9 100644 --- a/butane_core/src/many.rs +++ b/butane_core/src/many.rs @@ -16,7 +16,7 @@ fn default_oc() -> OnceCell> { /// U::PKType. Table name is T_ManyToMany_foo where foo is the name of /// the Many field // -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct Many where T: DataObject, @@ -153,6 +153,7 @@ where }); vals.map(|v| v.iter()) } + pub fn columns(&self) -> [Column; 2] { [ Column::new("owner", self.owner_type.clone()),