Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timely: derive trivial clone and copy implementations #430

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions timely/src/dataflow/operators/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl<G: Scope, D: Data> Probe<G, D> for Stream<G, D> {
}

/// Reports information about progress at the probe.
#[derive(Debug)]
#[derive(Debug,Clone)]
pub struct Handle<T:Timestamp> {
frontier: Rc<RefCell<MutableAntichain<T>>>
}
Expand Down Expand Up @@ -171,14 +171,6 @@ impl<T: Timestamp> Handle<T> {
}
}

impl<T: Timestamp> Clone for Handle<T> {
fn clone(&self) -> Self {
Handle {
frontier: self.frontier.clone()
}
}
}

impl<T> Default for Handle<T>
where
T: Timestamp,
Expand Down
20 changes: 2 additions & 18 deletions timely/src/dataflow/scopes/child.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -22,6 +22,7 @@ pub type Iterative<'a, G, T> = Child<'a, G, Product<<G as ScopeParent>::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,
Expand Down Expand Up @@ -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<G::Timestamp>
{
fn clone(&self) -> Self {
Child {
subgraph: self.subgraph,
parent: self.parent.clone(),
logging: self.logging.clone(),
progress_logging: self.progress_logging.clone(),
}
}
}
4 changes: 1 addition & 3 deletions timely/src/progress/frontier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ impl<T: PartialOrder+Ord+Clone, I: IntoIterator<Item=(T,i64)>> 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],
Expand All @@ -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.
///
Expand Down