File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -225,27 +225,27 @@ pub use left_right::ReadGuard;
225225///
226226/// The predicate function is called once for each distinct value, and `true` if this is the
227227/// _first_ call to the predicate on the _second_ application of the operation.
228- pub struct Predicate < V > ( pub ( crate ) Box < dyn FnMut ( & V , bool ) -> bool + Send > ) ;
228+ pub struct Predicate < V : ? Sized > ( pub ( crate ) Box < dyn FnMut ( & V , bool ) -> bool + Send > ) ;
229229
230- impl < V > Predicate < V > {
230+ impl < V : ? Sized > Predicate < V > {
231231 /// Evaluate the predicate for the given element
232232 #[ inline]
233233 pub fn eval ( & mut self , value : & V , reset : bool ) -> bool {
234234 ( * self . 0 ) ( value, reset)
235235 }
236236}
237237
238- impl < V > PartialEq for Predicate < V > {
238+ impl < V : ? Sized > PartialEq for Predicate < V > {
239239 #[ inline]
240240 fn eq ( & self , other : & Self ) -> bool {
241241 // only compare data, not vtable: https://stackoverflow.com/q/47489449/472927
242242 & * self . 0 as * const _ as * const ( ) == & * other. 0 as * const _ as * const ( )
243243 }
244244}
245245
246- impl < V > Eq for Predicate < V > { }
246+ impl < V : ? Sized > Eq for Predicate < V > { }
247247
248- impl < V > fmt:: Debug for Predicate < V > {
248+ impl < V : ? Sized > fmt:: Debug for Predicate < V > {
249249 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
250250 f. debug_tuple ( "Predicate" )
251251 . field ( & format_args ! ( "{:p}" , & * self . 0 as * const _) )
You can’t perform that action at this time.
0 commit comments