Skip to content

Commit 6db4ca3

Browse files
authored
Merge pull request #180 from marienz/master
feat: implement `PredicateBoxExt` for `?Sized` `Item`s
2 parents 5bd6da7 + 7cd735b commit 6db4ca3

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77
<!-- next-header -->
88
## [Unreleased] - ReleaseDate
99

10+
### Added
11+
12+
- The `boxed` function is now available for predicates with an `Item` type that
13+
is not `Sized`.
14+
1015
## [3.1.2] - 2024-07-25
1116

1217
## [3.1.1] - 2024-07-25

src/boxed.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,15 @@ where
114114
}
115115
}
116116

117-
impl<P, Item> PredicateBoxExt<Item> for P where P: Predicate<Item> {}
117+
impl<P, Item: ?Sized> PredicateBoxExt<Item> for P where P: Predicate<Item> {}
118+
119+
#[cfg(test)]
120+
mod test {
121+
use crate::prelude::*;
122+
123+
#[test]
124+
fn unsized_boxed() {
125+
let p = predicate::always().boxed();
126+
p.eval("4");
127+
}
128+
}

0 commit comments

Comments
 (0)