1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-27 16:29:02 +02:00

attribute nits

This commit is contained in:
Rob Ede
2021-01-26 09:45:43 +00:00
parent eaefe21b98
commit cff9deb729
4 changed files with 15 additions and 15 deletions

View File

@ -50,20 +50,20 @@ impl<T: ResourcePath> Path<T> {
}
}
#[inline]
/// Get reference to inner path instance
#[inline]
pub fn get_ref(&self) -> &T {
&self.path
}
#[inline]
/// Get mutable reference to inner path instance
#[inline]
pub fn get_mut(&mut self) -> &mut T {
&mut self.path
}
#[inline]
/// Path
#[inline]
pub fn path(&self) -> &str {
let skip = self.skip as usize;
let path = self.path.path();
@ -74,23 +74,23 @@ impl<T: ResourcePath> Path<T> {
}
}
#[inline]
/// Set new path
#[inline]
pub fn set(&mut self, path: T) {
self.skip = 0;
self.path = path;
self.segments.clear();
}
#[inline]
/// Reset state
#[inline]
pub fn reset(&mut self) {
self.skip = 0;
self.segments.clear();
}
#[inline]
/// Skip first `n` chars in path
#[inline]
pub fn skip(&mut self, n: u16) {
self.skip += n;
}
@ -109,14 +109,14 @@ impl<T: ResourcePath> Path<T> {
self.segments.push((name, PathItem::Static(value)));
}
#[inline]
/// Check if there are any matched patterns
#[inline]
pub fn is_empty(&self) -> bool {
self.segments.is_empty()
}
#[inline]
/// Check number of extracted parameters
#[inline]
pub fn len(&self) -> usize {
self.segments.len()
}

View File

@ -154,8 +154,8 @@ impl ResourceDef {
&self.pattern
}
#[inline]
/// Check if path matches this pattern.
#[inline]
pub fn is_match(&self, path: &str) -> bool {
match self.tp {
PatternType::Static(ref s) => s == path,