From a975c4dbdd7eb295f5fc73a574044623a604f68d Mon Sep 17 00:00:00 2001 From: ITOH Date: Sat, 4 Jun 2022 19:19:05 +0200 Subject: [PATCH 1/4] feat(model): derive `Default` for `ActionRow` Since action rows only contain a components vector deriving default should be no problem. --- model/src/application/component/action_row.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/src/application/component/action_row.rs b/model/src/application/component/action_row.rs index 777a8338887..34aa25f8728 100644 --- a/model/src/application/component/action_row.rs +++ b/model/src/application/component/action_row.rs @@ -5,7 +5,7 @@ use crate::application::component::Component; /// Refer to [Discord Docs/Message Components] for additional information. /// /// [Discord Docs/Message Components]: https://discord.com/developers/docs/interactions/message-components#action-rows -#[derive(Clone, Debug, Eq, Hash, PartialEq)] +#[derive(Clone, Debug, Default, Eq, Hash, PartialEq)] pub struct ActionRow { /// List of components in the action row. pub components: Vec, From c7655269706aeb2521af37e921a404eb3375929e Mon Sep 17 00:00:00 2001 From: ITOH Date: Sat, 4 Jun 2022 19:21:53 +0200 Subject: [PATCH 2/4] tests --- model/src/application/component/action_row.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/src/application/component/action_row.rs b/model/src/application/component/action_row.rs index 34aa25f8728..2c617459006 100644 --- a/model/src/application/component/action_row.rs +++ b/model/src/application/component/action_row.rs @@ -18,5 +18,5 @@ mod tests { use std::{fmt::Debug, hash::Hash}; assert_fields!(ActionRow: components); - assert_impl_all!(ActionRow: Clone, Debug, Eq, Hash, PartialEq, Send, Sync); + assert_impl_all!(ActionRow: Clone, Debug, Debug, Eq, Hash, PartialEq, Send, Sync); } From 3f8d2cf23e011fb3f2454a479e2687fe95a23148 Mon Sep 17 00:00:00 2001 From: ITOH Date: Sat, 4 Jun 2022 19:23:15 +0200 Subject: [PATCH 3/4] wrong --- model/src/application/component/action_row.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/src/application/component/action_row.rs b/model/src/application/component/action_row.rs index 2c617459006..243ed82c043 100644 --- a/model/src/application/component/action_row.rs +++ b/model/src/application/component/action_row.rs @@ -18,5 +18,5 @@ mod tests { use std::{fmt::Debug, hash::Hash}; assert_fields!(ActionRow: components); - assert_impl_all!(ActionRow: Clone, Debug, Debug, Eq, Hash, PartialEq, Send, Sync); + assert_impl_all!(ActionRow: Clone, Debug, Default, Eq, Hash, PartialEq, Send, Sync); } From 71dffe98ce12043ad2f227ee73ac7d275c562e40 Mon Sep 17 00:00:00 2001 From: ITOH Date: Sat, 4 Jun 2022 19:28:17 +0200 Subject: [PATCH 4/4] always forgetting the fmt --- model/src/application/component/action_row.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/model/src/application/component/action_row.rs b/model/src/application/component/action_row.rs index 243ed82c043..e99d359ffa9 100644 --- a/model/src/application/component/action_row.rs +++ b/model/src/application/component/action_row.rs @@ -18,5 +18,14 @@ mod tests { use std::{fmt::Debug, hash::Hash}; assert_fields!(ActionRow: components); - assert_impl_all!(ActionRow: Clone, Debug, Default, Eq, Hash, PartialEq, Send, Sync); + assert_impl_all!( + ActionRow: Clone, + Debug, + Default, + Eq, + Hash, + PartialEq, + Send, + Sync + ); }