Skip to content

Commit d6d1e31

Browse files
committed
Tidy names, correct doctest, update CI
1 parent 1ff5f02 commit d6d1e31

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
toolchain: ${{ matrix.toolchain }}
2626
- name: Cargo test
2727
run: cargo test --workspace --all-targets
28+
- name: Cargo doc test
29+
run: cargo test --doc
2830

2931
# Check formatting with rustfmt
3032
mdbook:

differential-dataflow/examples/iterate_container.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use timely::dataflow::operators::generic::builder_rc::OperatorBuilder;
88
use differential_dataflow::{AsCollection, Collection};
99
use differential_dataflow::input::Input;
1010
use differential_dataflow::operators::iterate::Variable;
11-
use differential_dataflow::collection::traits::{Enter, Leave, Negate, ResultsIn};
11+
use differential_dataflow::collection::containers::{Enter, Leave, Negate, ResultsIn};
1212

1313
/// A wrapper around a container that implements the necessary traits to be used in iterative scopes.
1414
#[derive(Clone, Default)]

differential-dataflow/src/collection.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ impl<G: Scope, D, R, C: Container> Collection<G, D, R, C> {
204204
/// .assert_eq(&evens);
205205
/// });
206206
/// ```
207-
pub fn negate(&self) -> Collection<G, D, R, C> where C: traits::Negate {
207+
pub fn negate(&self) -> Collection<G, D, R, C> where C: containers::Negate {
208208
use timely::dataflow::channels::pact::Pipeline;
209209
self.inner
210210
.unary(Pipeline, "Negate", move |_,_| move |input, output| {
@@ -233,9 +233,9 @@ impl<G: Scope, D, R, C: Container> Collection<G, D, R, C> {
233233
/// data.assert_eq(&result);
234234
/// });
235235
/// ```
236-
pub fn enter<'a, T>(&self, child: &Child<'a, G, T>) -> Collection<Child<'a, G, T>, D, R, <C as traits::Enter<<G as ScopeParent>::Timestamp, T>>::InnerContainer>
236+
pub fn enter<'a, T>(&self, child: &Child<'a, G, T>) -> Collection<Child<'a, G, T>, D, R, <C as containers::Enter<<G as ScopeParent>::Timestamp, T>>::InnerContainer>
237237
where
238-
C: traits::Enter<<G as ScopeParent>::Timestamp, T, InnerContainer: Container>,
238+
C: containers::Enter<<G as ScopeParent>::Timestamp, T, InnerContainer: Container>,
239239
T: Refines<<G as ScopeParent>::Timestamp>,
240240
{
241241
use timely::dataflow::channels::pact::Pipeline;
@@ -258,7 +258,6 @@ impl<G: Scope, D, R, C: Container> Collection<G, D, R, C> {
258258
/// use timely::dataflow::operators::{ToStream, Concat, Inspect, BranchWhen};
259259
///
260260
/// use differential_dataflow::input::Input;
261-
/// use differential_dataflow::operators::ResultsIn;
262261
///
263262
/// timely::example(|scope| {
264263
/// let summary1 = 5;
@@ -270,7 +269,7 @@ impl<G: Scope, D, R, C: Container> Collection<G, D, R, C> {
270269
/// ```
271270
pub fn results_in(&self, step: <G::Timestamp as Timestamp>::Summary) -> Self
272271
where
273-
C: traits::ResultsIn<<G::Timestamp as Timestamp>::Summary>,
272+
C: containers::ResultsIn<<G::Timestamp as Timestamp>::Summary>,
274273
{
275274
use timely::dataflow::channels::pact::Pipeline;
276275
self.inner
@@ -597,7 +596,7 @@ use timely::progress::timestamp::Refines;
597596
/// Methods requiring a nested scope.
598597
impl<'a, G: Scope, T: Timestamp, D: Clone+'static, R: Clone+'static, C: Container> Collection<Child<'a, G, T>, D, R, C>
599598
where
600-
C: traits::Leave<T, G::Timestamp, OuterContainer: Container>,
599+
C: containers::Leave<T, G::Timestamp, OuterContainer: Container>,
601600
T: Refines<<G as ScopeParent>::Timestamp>,
602601
{
603602
/// Returns the final value of a Collection from a nested scope to its containing scope.
@@ -620,7 +619,7 @@ where
620619
/// data.assert_eq(&result);
621620
/// });
622621
/// ```
623-
pub fn leave(&self) -> Collection<G, D, R, <C as traits::Leave<T, G::Timestamp>>::OuterContainer> {
622+
pub fn leave(&self) -> Collection<G, D, R, <C as containers::Leave<T, G::Timestamp>>::OuterContainer> {
624623
use timely::dataflow::channels::pact::Pipeline;
625624
self.inner
626625
.leave()
@@ -733,7 +732,7 @@ where
733732
}
734733

735734
/// Traits that can be implemented by containers to provide functionality to collections based on them.
736-
pub mod traits {
735+
pub mod containers {
737736

738737
use timely::progress::{Timestamp, timestamp::Refines};
739738
use crate::collection::Abelian;
@@ -791,4 +790,4 @@ pub mod traits {
791790
self.into_iter().filter_map(move |(d,t,r)| step.results_in(&t).map(|t| (d,t,r))).collect()
792791
}
793792
}
794-
}
793+
}

differential-dataflow/src/operators/iterate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ where
167167
impl<G, D: Data, R: Abelian, C: Container> Variable<G, D, R, C>
168168
where
169169
G: Scope<Timestamp: Lattice>,
170-
C: crate::collection::traits::Negate + crate::collection::traits::ResultsIn<<G::Timestamp as Timestamp>::Summary>,
170+
C: crate::collection::containers::Negate + crate::collection::containers::ResultsIn<<G::Timestamp as Timestamp>::Summary>,
171171
{
172172
/// Creates a new initially empty `Variable`.
173173
///
@@ -246,7 +246,7 @@ where
246246
impl<G, D: Data, R: Semigroup, C: Container> SemigroupVariable<G, D, R, C>
247247
where
248248
G: Scope<Timestamp: Lattice>,
249-
C: crate::collection::traits::ResultsIn<<G::Timestamp as Timestamp>::Summary>,
249+
C: crate::collection::containers::ResultsIn<<G::Timestamp as Timestamp>::Summary>,
250250
{
251251
/// Creates a new initially empty `SemigroupVariable`.
252252
pub fn new(scope: &mut G, step: <G::Timestamp as Timestamp>::Summary) -> Self {

0 commit comments

Comments
 (0)