1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-08-31 23:16:58 +02:00

rename Pattern to ResourceDef

This commit is contained in:
Nikolay Kim
2019-02-09 07:24:35 -08:00
parent 17d0f84f63
commit 9979bfb3ef
6 changed files with 102 additions and 64 deletions

View File

@@ -4,7 +4,7 @@ use std::rc::Rc;
use serde::de;
use crate::de::PathDeserializer;
use crate::RequestPath;
use crate::ResourcePath;
#[derive(Debug, Clone, Copy)]
pub(crate) enum PathItem {
@@ -42,7 +42,7 @@ impl<T: Clone> Clone for Path<T> {
}
}
impl<T: RequestPath> Path<T> {
impl<T: ResourcePath> Path<T> {
pub fn new(path: T) -> Path<T> {
Path {
path,
@@ -165,7 +165,7 @@ pub struct PathIter<'a, T> {
params: &'a Path<T>,
}
impl<'a, T: RequestPath> Iterator for PathIter<'a, T> {
impl<'a, T: ResourcePath> Iterator for PathIter<'a, T> {
type Item = (&'a str, &'a str);
#[inline]
@@ -183,7 +183,7 @@ impl<'a, T: RequestPath> Iterator for PathIter<'a, T> {
}
}
impl<'a, T: RequestPath> Index<&'a str> for Path<T> {
impl<'a, T: ResourcePath> Index<&'a str> for Path<T> {
type Output = str;
fn index(&self, name: &'a str) -> &str {
@@ -192,7 +192,7 @@ impl<'a, T: RequestPath> Index<&'a str> for Path<T> {
}
}
impl<T: RequestPath> Index<usize> for Path<T> {
impl<T: ResourcePath> Index<usize> for Path<T> {
type Output = str;
fn index(&self, idx: usize) -> &str {