From aa9ddbedb1e5055ccd455219a6b5c07724208679 Mon Sep 17 00:00:00 2001 From: IFcoltransG <47414286+IFcoltransG@users.noreply.github.com> Date: Sun, 14 Dec 2025 23:54:40 +1300 Subject: [PATCH] Break up long comment lines --- src/treefrog.rs | 38 ++++++++++++++++++++++++++------------ src/variable.rs | 11 +++++++---- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/src/treefrog.rs b/src/treefrog.rs index 3cc8a6e..b26f13e 100644 --- a/src/treefrog.rs +++ b/src/treefrog.rs @@ -288,7 +288,9 @@ pub(crate) mod filters { pub trait RelationLeaper { /// Extend with `Val` using the elements of the relation. /// - /// 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. + /// 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. fn extend_with<'leap, Tuple: Ord, Func: Fn(&Tuple) -> Key>( &'leap self, key_func: Func, @@ -298,7 +300,9 @@ pub trait RelationLeaper { Val: 'leap; /// Extend with `Val` using the complement of the relation. /// - /// 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. + /// 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. fn extend_anti<'leap, Tuple: Ord, Func: Fn(&Tuple) -> Key>( &'leap self, key_func: Func, @@ -308,7 +312,8 @@ pub trait RelationLeaper { Val: 'leap; /// Extend with any value if tuple is present in relation. /// - /// 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. + /// 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. fn filter_with<'leap, Tuple: Ord, Func: Fn(&Tuple) -> (Key, Val)>( &'leap self, key_func: Func, @@ -318,7 +323,8 @@ pub trait RelationLeaper { Val: 'leap; /// Extend with any value if tuple is absent from relation. /// - /// 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. + /// 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. fn filter_anti<'leap, Tuple: Ord, Func: Fn(&Tuple) -> (Key, Val)>( &'leap self, key_func: Func, @@ -375,9 +381,11 @@ pub(crate) mod extend_with { use super::{binary_search, Leaper, Leapers, Relation}; use crate::join::gallop; - /// Wraps a `Relation` as a [`Leaper`] that maps each source tuple to a key and adds the relation's corresponding values. + /// Wraps a `Relation` as a [`Leaper`] that maps each source tuple to a + /// key and adds the relation's corresponding values. /// - /// This struct is created using the [`extend_with`](`crate::RelationLeaper::extend_with`) method on [`Relation`s](Relation). + /// This struct is created using the [`extend_with`](`crate::RelationLeaper::extend_with`) + /// method on [`Relation`s](Relation). pub struct ExtendWith<'leap, Key, Val, Tuple, Func> where Key: Ord + 'leap, @@ -476,9 +484,11 @@ pub(crate) mod extend_anti { use super::{binary_search, Leaper, Relation}; use crate::join::gallop; - /// Wraps a `Relation` as a [`Leaper`] that maps each source tuple to a key and removes the relation's corresponding values. + /// Wraps a `Relation` as a [`Leaper`] that maps each source tuple to a + /// key and removes the relation's corresponding values. /// - /// This struct is created using the [`extend_anti`](`crate::RelationLeaper::extend_anti`) method on [`Relation`s](Relation). + /// This struct is created using the [`extend_anti`](`crate::RelationLeaper::extend_anti`) + /// method on [`Relation`s](Relation). pub struct ExtendAnti<'leap, Key, Val, Tuple, Func> where Key: Ord + 'leap, @@ -557,9 +567,11 @@ pub(crate) mod filter_with { use super::{Leaper, Leapers, Relation}; - /// Wraps a `Relation` as a [`Leaper`] that keeps only source tuples mapping to a key in the relation. + /// Wraps a `Relation` as a [`Leaper`] that keeps only source tuples mapping + /// to a key in the relation. /// - /// This struct is created using the [`filter_with`](`crate::RelationLeaper::filter_with`) method on [`Relation`s](Relation). + /// This struct is created using the [`filter_with`](`crate::RelationLeaper::filter_with`) + /// method on [`Relation`s](Relation). pub struct FilterWith<'leap, Key, Val, Tuple, Func> where Key: Ord + 'leap, @@ -652,9 +664,11 @@ pub(crate) mod filter_anti { use super::{Leaper, Leapers, Relation}; - /// Wraps a `Relation` as a [`Leaper`] that keeps only source tuples not mapping to a key in the relation. + /// Wraps a `Relation` as a [`Leaper`] that keeps only source tuples not + /// mapping to a key in the relation. /// - /// This struct is created using the [`filter_anti`](`crate::RelationLeaper::filter_anti`) method on [`Relation`s](Relation). + /// This struct is created using the [`filter_anti`](`crate::RelationLeaper::filter_anti`) + /// method on [`Relation`s](Relation). pub struct FilterAnti<'leap, Key, Val, Tuple, Func> where Key: Ord + 'leap, diff --git a/src/variable.rs b/src/variable.rs index 76d89c2..ad5e7b5 100644 --- a/src/variable.rs +++ b/src/variable.rs @@ -251,13 +251,16 @@ impl Variable { /// You can create a leaper in one of two ways: /// - Extension: In this case, you have a relation of type `(K, Val)` for some /// type `K`. You provide a closure that maps from `SourceTuple` to the key - /// `K`. If you use [`relation.extend_with`](`crate::RelationLeaper::extend_with`), then any `Val` values the - /// relation provides will be added to the set of values; if you use - /// [`extend_anti`](`crate::RelationLeaper::extend_anti`), then the `Val` values will be removed. + /// `K`. If you use [`relation.extend_with`](`crate::RelationLeaper::extend_with`), + /// then any `Val` values the relation provides will be added to the set of + /// values; if you use [`extend_anti`](`crate::RelationLeaper::extend_anti`), + /// then the `Val` values will be removed. /// - Filtering: In this case, you have a relation of type `K` for some /// type `K` and you provide a closure that maps from `SourceTuple` to /// the key `K`. Filters don't provide values but they remove source - /// tuples. [`filter_with`](`crate::RelationLeaper::filter_with`) retains matching keys, whereas [`filter_anti`](`crate::RelationLeaper::filter_anti`) removes matching keys. + /// tuples. [`filter_with`](`crate::RelationLeaper::filter_with`) retains + /// matching keys, whereas [`filter_anti`](`crate::RelationLeaper::filter_anti`) + /// removes matching keys. /// - Finally, you get a callback `logic` that accepts each `(SourceTuple, Val)` /// that was successfully joined (and not filtered) and which maps to the /// type of this variable.