1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 08:57:00 +02:00

remove box from predicates

This commit is contained in:
Nikolay Kim
2017-12-20 13:23:50 -08:00
parent 813b56ebe5
commit 79f047f5be
5 changed files with 99 additions and 51 deletions

View File

@@ -57,8 +57,8 @@ impl<S: 'static> Route<S> {
/// # .finish();
/// # }
/// ```
pub fn p(&mut self, p: Box<Predicate<S>>) -> &mut Self {
self.preds.push(p);
pub fn p<T: Predicate<S> + 'static>(&mut self, p: T) -> &mut Self {
self.preds.push(Box::new(p));
self
}