diff options
Diffstat (limited to 'vendor/datafrog/src/map.rs')
-rw-r--r-- | vendor/datafrog/src/map.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/vendor/datafrog/src/map.rs b/vendor/datafrog/src/map.rs new file mode 100644 index 000000000..1a8c10128 --- /dev/null +++ b/vendor/datafrog/src/map.rs @@ -0,0 +1,13 @@ +//! Map functionality. + +use super::{Relation, Variable}; + +pub(crate) fn map_into<T1: Ord, T2: Ord>( + input: &Variable<T1>, + output: &Variable<T2>, + logic: impl FnMut(&T1) -> T2, +) { + let results: Vec<T2> = input.recent.borrow().iter().map(logic).collect(); + + output.insert(Relation::from_vec(results)); +} |