From cd9c9c128e4284ad3aa4e50fa11100137fa88d10 Mon Sep 17 00:00:00 2001 From: Petros Angelatos Date: Wed, 3 Nov 2021 12:45:01 +0100 Subject: [PATCH] timely: derive trivial clone and copy implementations `timely::progress::Timestamp` implies `Clone`, so the derived implementation will have the correct trait bounds. Signed-off-by: Petros Angelatos --- timely/src/dataflow/operators/probe.rs | 10 +--------- timely/src/dataflow/scopes/child.rs | 20 ++------------------ timely/src/progress/frontier.rs | 4 +--- 3 files changed, 4 insertions(+), 30 deletions(-) diff --git a/timely/src/dataflow/operators/probe.rs b/timely/src/dataflow/operators/probe.rs index 124be5972..85e0b7278 100644 --- a/timely/src/dataflow/operators/probe.rs +++ b/timely/src/dataflow/operators/probe.rs @@ -137,7 +137,7 @@ impl Probe for Stream { } /// Reports information about progress at the probe. -#[derive(Debug)] +#[derive(Debug,Clone)] pub struct Handle { frontier: Rc>> } @@ -171,14 +171,6 @@ impl Handle { } } -impl Clone for Handle { - fn clone(&self) -> Self { - Handle { - frontier: self.frontier.clone() - } - } -} - impl Default for Handle where T: Timestamp, diff --git a/timely/src/dataflow/scopes/child.rs b/timely/src/dataflow/scopes/child.rs index 07789304c..6dabc985e 100644 --- a/timely/src/dataflow/scopes/child.rs +++ b/timely/src/dataflow/scopes/child.rs @@ -3,7 +3,7 @@ use std::rc::Rc; use std::cell::RefCell; -use crate::communication::{Data, Push, Pull}; +use crate::communication::{Data, Message, Push, Pull}; use crate::communication::allocator::thread::{ThreadPusher, ThreadPuller}; use crate::scheduling::Scheduler; use crate::scheduling::activate::Activations; @@ -22,6 +22,7 @@ pub type Iterative<'a, G, T> = Child<'a, G, Product<::Timestam /// A `Child` wraps a `Subgraph` and a parent `G: Scope`. It manages the addition /// of `Operate`s to a subgraph, and the connection of edges between them. +#[derive(Clone)] pub struct Child<'a, G, T> where G: ScopeParent, @@ -135,20 +136,3 @@ where result } } - -use crate::communication::Message; - -impl<'a, G, T> Clone for Child<'a, G, T> -where - G: ScopeParent, - T: Timestamp+Refines -{ - fn clone(&self) -> Self { - Child { - subgraph: self.subgraph, - parent: self.parent.clone(), - logging: self.logging.clone(), - progress_logging: self.progress_logging.clone(), - } - } -} diff --git a/timely/src/progress/frontier.rs b/timely/src/progress/frontier.rs index ecba92310..26b466a18 100644 --- a/timely/src/progress/frontier.rs +++ b/timely/src/progress/frontier.rs @@ -584,7 +584,7 @@ impl> MutableAntichainF } /// A wrapper for elements of an antichain. -#[derive(Debug)] +#[derive(Debug,Copy)] pub struct AntichainRef<'a, T: 'a> { /// Elements contained in the antichain. frontier: &'a [T], @@ -598,8 +598,6 @@ impl<'a, T: 'a> Clone for AntichainRef<'a, T> { } } -impl<'a, T: 'a> Copy for AntichainRef<'a, T> { } - impl<'a, T: 'a> AntichainRef<'a, T> { /// Create a new `AntichainRef` from a reference to a slice of elements forming the frontier. ///