Skip to content

Commit f78524c

Browse files
authored
Merge pull request #56 from IFcoltransG/comment-line-length
Break up long comment lines
2 parents b6d8981 + aa9ddbe commit f78524c

2 files changed

Lines changed: 33 additions & 16 deletions

File tree

src/treefrog.rs

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ pub(crate) mod filters {
288288
pub trait RelationLeaper<Key: Ord, Val: Ord> {
289289
/// Extend with `Val` using the elements of the relation.
290290
///
291-
/// When used in a [leapjoin](`crate::Variable::from_leapjoin`), each source tuple is mapped to a key, the key is looked up in this relation, then all corresponding values are added to the source.
291+
/// When used in a [leapjoin](`crate::Variable::from_leapjoin`), each source tuple
292+
/// is mapped to a key, the key is looked up in this relation, then all corresponding
293+
/// values are added to the source.
292294
fn extend_with<'leap, Tuple: Ord, Func: Fn(&Tuple) -> Key>(
293295
&'leap self,
294296
key_func: Func,
@@ -298,7 +300,9 @@ pub trait RelationLeaper<Key: Ord, Val: Ord> {
298300
Val: 'leap;
299301
/// Extend with `Val` using the complement of the relation.
300302
///
301-
/// When used in a [leapjoin](`crate::Variable::from_leapjoin`), each source tuple is mapped to a key, the key is looked up in this relation, then all corresponding values are removed from the source.
303+
/// When used in a [leapjoin](`crate::Variable::from_leapjoin`), each source tuple
304+
/// is mapped to a key, the key is looked up in this relation, then all corresponding
305+
/// values are removed from the source.
302306
fn extend_anti<'leap, Tuple: Ord, Func: Fn(&Tuple) -> Key>(
303307
&'leap self,
304308
key_func: Func,
@@ -308,7 +312,8 @@ pub trait RelationLeaper<Key: Ord, Val: Ord> {
308312
Val: 'leap;
309313
/// Extend with any value if tuple is present in relation.
310314
///
311-
/// When used in a [leapjoin](`crate::Variable::from_leapjoin`), each source tuple is mapped to a key, then only keys found in the relation are kept in the source.
315+
/// When used in a [leapjoin](`crate::Variable::from_leapjoin`), each source tuple
316+
/// is mapped to a key, then only keys found in the relation are kept in the source.
312317
fn filter_with<'leap, Tuple: Ord, Func: Fn(&Tuple) -> (Key, Val)>(
313318
&'leap self,
314319
key_func: Func,
@@ -318,7 +323,8 @@ pub trait RelationLeaper<Key: Ord, Val: Ord> {
318323
Val: 'leap;
319324
/// Extend with any value if tuple is absent from relation.
320325
///
321-
/// When used in a [leapjoin](`crate::Variable::from_leapjoin`), each source tuple is mapped to a key, then all keys found in the relation are removed from the source.
326+
/// When used in a [leapjoin](`crate::Variable::from_leapjoin`), each source tuple
327+
/// is mapped to a key, then all keys found in the relation are removed from the source.
322328
fn filter_anti<'leap, Tuple: Ord, Func: Fn(&Tuple) -> (Key, Val)>(
323329
&'leap self,
324330
key_func: Func,
@@ -375,9 +381,11 @@ pub(crate) mod extend_with {
375381
use super::{binary_search, Leaper, Leapers, Relation};
376382
use crate::join::gallop;
377383

378-
/// Wraps a `Relation<Tuple>` as a [`Leaper`] that maps each source tuple to a key and adds the relation's corresponding values.
384+
/// Wraps a `Relation<Tuple>` as a [`Leaper`] that maps each source tuple to a
385+
/// key and adds the relation's corresponding values.
379386
///
380-
/// This struct is created using the [`extend_with`](`crate::RelationLeaper::extend_with`) method on [`Relation`s](Relation).
387+
/// This struct is created using the [`extend_with`](`crate::RelationLeaper::extend_with`)
388+
/// method on [`Relation`s](Relation).
381389
pub struct ExtendWith<'leap, Key, Val, Tuple, Func>
382390
where
383391
Key: Ord + 'leap,
@@ -476,9 +484,11 @@ pub(crate) mod extend_anti {
476484
use super::{binary_search, Leaper, Relation};
477485
use crate::join::gallop;
478486

479-
/// Wraps a `Relation<Tuple>` as a [`Leaper`] that maps each source tuple to a key and removes the relation's corresponding values.
487+
/// Wraps a `Relation<Tuple>` as a [`Leaper`] that maps each source tuple to a
488+
/// key and removes the relation's corresponding values.
480489
///
481-
/// This struct is created using the [`extend_anti`](`crate::RelationLeaper::extend_anti`) method on [`Relation`s](Relation).
490+
/// This struct is created using the [`extend_anti`](`crate::RelationLeaper::extend_anti`)
491+
/// method on [`Relation`s](Relation).
482492
pub struct ExtendAnti<'leap, Key, Val, Tuple, Func>
483493
where
484494
Key: Ord + 'leap,
@@ -557,9 +567,11 @@ pub(crate) mod filter_with {
557567

558568
use super::{Leaper, Leapers, Relation};
559569

560-
/// Wraps a `Relation<Tuple>` as a [`Leaper`] that keeps only source tuples mapping to a key in the relation.
570+
/// Wraps a `Relation<Tuple>` as a [`Leaper`] that keeps only source tuples mapping
571+
/// to a key in the relation.
561572
///
562-
/// This struct is created using the [`filter_with`](`crate::RelationLeaper::filter_with`) method on [`Relation`s](Relation).
573+
/// This struct is created using the [`filter_with`](`crate::RelationLeaper::filter_with`)
574+
/// method on [`Relation`s](Relation).
563575
pub struct FilterWith<'leap, Key, Val, Tuple, Func>
564576
where
565577
Key: Ord + 'leap,
@@ -652,9 +664,11 @@ pub(crate) mod filter_anti {
652664

653665
use super::{Leaper, Leapers, Relation};
654666

655-
/// Wraps a `Relation<Tuple>` as a [`Leaper`] that keeps only source tuples not mapping to a key in the relation.
667+
/// Wraps a `Relation<Tuple>` as a [`Leaper`] that keeps only source tuples not
668+
/// mapping to a key in the relation.
656669
///
657-
/// This struct is created using the [`filter_anti`](`crate::RelationLeaper::filter_anti`) method on [`Relation`s](Relation).
670+
/// This struct is created using the [`filter_anti`](`crate::RelationLeaper::filter_anti`)
671+
/// method on [`Relation`s](Relation).
658672
pub struct FilterAnti<'leap, Key, Val, Tuple, Func>
659673
where
660674
Key: Ord + 'leap,

src/variable.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,16 @@ impl<Tuple: Ord> Variable<Tuple> {
251251
/// You can create a leaper in one of two ways:
252252
/// - Extension: In this case, you have a relation of type `(K, Val)` for some
253253
/// type `K`. You provide a closure that maps from `SourceTuple` to the key
254-
/// `K`. If you use [`relation.extend_with`](`crate::RelationLeaper::extend_with`), then any `Val` values the
255-
/// relation provides will be added to the set of values; if you use
256-
/// [`extend_anti`](`crate::RelationLeaper::extend_anti`), then the `Val` values will be removed.
254+
/// `K`. If you use [`relation.extend_with`](`crate::RelationLeaper::extend_with`),
255+
/// then any `Val` values the relation provides will be added to the set of
256+
/// values; if you use [`extend_anti`](`crate::RelationLeaper::extend_anti`),
257+
/// then the `Val` values will be removed.
257258
/// - Filtering: In this case, you have a relation of type `K` for some
258259
/// type `K` and you provide a closure that maps from `SourceTuple` to
259260
/// the key `K`. Filters don't provide values but they remove source
260-
/// tuples. [`filter_with`](`crate::RelationLeaper::filter_with`) retains matching keys, whereas [`filter_anti`](`crate::RelationLeaper::filter_anti`) removes matching keys.
261+
/// tuples. [`filter_with`](`crate::RelationLeaper::filter_with`) retains
262+
/// matching keys, whereas [`filter_anti`](`crate::RelationLeaper::filter_anti`)
263+
/// removes matching keys.
261264
/// - Finally, you get a callback `logic` that accepts each `(SourceTuple, Val)`
262265
/// that was successfully joined (and not filtered) and which maps to the
263266
/// type of this variable.

0 commit comments

Comments
 (0)