This commit is contained in:
Nikolay Kim 2022-01-11 10:56:37 +06:00
parent e9bbe84cba
commit b2fd0ee3ac
3 changed files with 4 additions and 4 deletions

View file

@ -217,7 +217,7 @@ impl TryFrom<&[u8]> for ByteString {
#[inline]
fn try_from(value: &[u8]) -> Result<Self, Self::Error> {
if utf8::is_valid(&value) {
if utf8::is_valid(value) {
Ok(ByteString(Bytes::copy_from_slice(value)))
} else {
Err(())

View file

@ -11,7 +11,7 @@ mod tree;
pub use self::de::PathDeserializer;
pub use self::path::{Path, PathIter};
pub use self::resource::ResourceDef;
pub use self::router::{Router, RouterBuilder};
pub use self::router::{ResourceId, Router, RouterBuilder};
#[doc(hidden)]
pub struct ResourceInfo;

View file

@ -1,8 +1,8 @@
use super::tree::Tree;
use super::{IntoPattern, Resource, ResourceDef, ResourcePath};
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct ResourceId(pub u16);
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct ResourceId(pub(crate) u16);
/// Resource router.
#[derive(Clone)]