diff --git a/src/resource.rs b/src/resource.rs index 2e83225e..3d8c4b98 100644 --- a/src/resource.rs +++ b/src/resource.rs @@ -1,6 +1,7 @@ use std::rc::Rc; use std::marker::PhantomData; +use smallvec::SmallVec; use http::{Method, StatusCode}; use pred; @@ -34,7 +35,7 @@ use httpresponse::HttpResponse; pub struct Resource { name: String, state: PhantomData, - routes: Vec>, + routes: SmallVec<[Route; 3]>, middlewares: Rc>>>, } @@ -43,7 +44,7 @@ impl Default for Resource { Resource { name: String::new(), state: PhantomData, - routes: Vec::new(), + routes: SmallVec::new(), middlewares: Rc::new(Vec::new()) } } } @@ -54,7 +55,7 @@ impl Resource { Resource { name: String::new(), state: PhantomData, - routes: Vec::new(), + routes: SmallVec::new(), middlewares: Rc::new(Vec::new()) } }