Skip to content

Commit

Permalink
Saner bounds.
Browse files Browse the repository at this point in the history
  • Loading branch information
01mf02 committed Jan 15, 2024
1 parent 9125d81 commit 56cfdf6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions jaq-interpret/src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ impl<'a> FilterT<'a> for Ref<'a> {
(
part.as_ref().map(move |i| {
let cvc = cvc.clone();
move || w(i).run(cvc)
move || w(i).run(cvc.clone())
}),
*opt,
)
Expand Down Expand Up @@ -401,7 +401,7 @@ impl<'a> FilterT<'a> for Ref<'a> {
(
part.map(|i| {
let cvc = cvc.clone();
move || i.run(cvc)
move || i.run(cvc.clone())
}),
opt,
)
Expand Down
8 changes: 4 additions & 4 deletions jaq-interpret/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl<'a, U: Clone + 'a> Path<U> {
pub fn combinations<I, F>(self, mut iter: I) -> BoxIter<'a, Self>
where
I: Iterator<Item = (Part<F>, Opt)> + Clone + 'a,
F: FnOnce() -> BoxIter<'a, U> + Clone + 'a,
F: Fn() -> BoxIter<'a, U> + 'a,
{
if let Some((part, opt)) = iter.next() {
let parts = part.into_iter();
Expand Down Expand Up @@ -178,19 +178,19 @@ impl Part<Val> {
}
}

impl<'a, U: Clone + 'a, F: FnOnce() -> BoxIter<'a, U> + Clone + 'a> Part<F> {
impl<'a, U: Clone + 'a, F: Fn() -> BoxIter<'a, U> + 'a> Part<F> {
fn into_iter(self) -> BoxIter<'a, Part<U>> {
use Part::{Index, Range};
match self {
Index(i) => Box::new(i().map(Index)),
Range(None, None) => box_once(Range(None, None)),
Range(Some(from), None) => Box::new(from().map(|from| Range(Some(from), None))),
Range(None, Some(upto)) => Box::new(upto().map(|upto| Range(None, Some(upto)))),
Range(Some(from), Some(upto)) => flat_map_with(from(), upto, move |from, upto| {
Range(Some(from), Some(upto)) => Box::new(from().flat_map(move |from| {
map_with(upto(), from, move |upto, from| {
Range(Some(from), Some(upto))
})
}),
})),
}
}
}
Expand Down

0 comments on commit 56cfdf6

Please sign in to comment.