From 64be92bb82cfb7d32ed85bb071b3bcfcccdb11fd Mon Sep 17 00:00:00 2001 From: Moritz Hoffmann Date: Sun, 26 Nov 2023 08:05:11 -0500 Subject: [PATCH] Manual Antichain::default to avoid bounds (#537) The derived `default` for Antichain includes a bound `T: Default`, which is unnecessary. This change replaces the derived implementation with a custom one that does not have the constrain. Signed-off-by: Moritz Hoffmann --- timely/src/progress/frontier.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/timely/src/progress/frontier.rs b/timely/src/progress/frontier.rs index 46012bcce..ba44de481 100644 --- a/timely/src/progress/frontier.rs +++ b/timely/src/progress/frontier.rs @@ -13,7 +13,7 @@ use crate::order::{PartialOrder, TotalOrder}; /// Two antichains are equal if the contain the same set of elements, even if in different orders. /// This can make equality testing quadratic, though linear in the common case that the sequences /// are identical. -#[derive(Debug, Default, Abomonation, Serialize, Deserialize)] +#[derive(Debug, Abomonation, Serialize, Deserialize)] pub struct Antichain { elements: Vec } @@ -264,6 +264,12 @@ impl Clone for Antichain { } } +impl Default for Antichain { + fn default() -> Self { + Self::new() + } +} + impl TotalOrder for Antichain { } impl Antichain {