@@ -143,9 +143,9 @@ impl<T: ResourcePath> Path<T> {
143143 for ( seg_name, val) in self . segments . iter ( ) {
144144 if name == seg_name {
145145 return match val {
146- PathItem :: Static ( ref s ) => Some ( s ) ,
147- PathItem :: Segment ( s , e ) => {
148- Some ( & self . path . path ( ) [ ( * s as usize ) ..( * e as usize ) ] )
146+ PathItem :: Static ( ref seg ) => Some ( seg ) ,
147+ PathItem :: Segment ( start , end ) => {
148+ Some ( & self . path . path ( ) [ ( * start as usize ) ..( * end as usize ) ] )
149149 }
150150 } ;
151151 }
@@ -193,8 +193,10 @@ impl<'a, T: ResourcePath> Iterator for PathIter<'a, T> {
193193 if self . idx < self . params . segment_count ( ) {
194194 let idx = self . idx ;
195195 let res = match self . params . segments [ idx] . 1 {
196- PathItem :: Static ( ref s) => s,
197- PathItem :: Segment ( s, e) => & self . params . path . path ( ) [ ( s as usize ) ..( e as usize ) ] ,
196+ PathItem :: Static ( ref seg) => seg,
197+ PathItem :: Segment ( start, end) => {
198+ & self . params . path . path ( ) [ ( start as usize ) ..( end as usize ) ]
199+ }
198200 } ;
199201 self . idx += 1 ;
200202 return Some ( ( & self . params . segments [ idx] . 0 , res) ) ;
@@ -217,8 +219,8 @@ impl<T: ResourcePath> Index<usize> for Path<T> {
217219
218220 fn index ( & self , idx : usize ) -> & str {
219221 match self . segments [ idx] . 1 {
220- PathItem :: Static ( ref s ) => s ,
221- PathItem :: Segment ( s , e ) => & self . path . path ( ) [ ( s as usize ) ..( e as usize ) ] ,
222+ PathItem :: Static ( ref seg ) => seg ,
223+ PathItem :: Segment ( start , end ) => & self . path . path ( ) [ ( start as usize ) ..( end as usize ) ] ,
222224 }
223225 }
224226}
0 commit comments