Skip to content

Commit 64be92b

Browse files
authored
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 <antiguru@gmail.com>
1 parent 98af39f commit 64be92b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

timely/src/progress/frontier.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::order::{PartialOrder, TotalOrder};
1313
/// Two antichains are equal if the contain the same set of elements, even if in different orders.
1414
/// This can make equality testing quadratic, though linear in the common case that the sequences
1515
/// are identical.
16-
#[derive(Debug, Default, Abomonation, Serialize, Deserialize)]
16+
#[derive(Debug, Abomonation, Serialize, Deserialize)]
1717
pub struct Antichain<T> {
1818
elements: Vec<T>
1919
}
@@ -264,6 +264,12 @@ impl<T: Clone> Clone for Antichain<T> {
264264
}
265265
}
266266

267+
impl<T> Default for Antichain<T> {
268+
fn default() -> Self {
269+
Self::new()
270+
}
271+
}
272+
267273
impl<T: TotalOrder> TotalOrder for Antichain<T> { }
268274

269275
impl<T: TotalOrder> Antichain<T> {

0 commit comments

Comments
 (0)