Added more restriction for blocks and zone names.

This commit is contained in:
Revertron
2021-03-16 12:24:31 +01:00
parent fb4ed70f7c
commit 394463ef15
8 changed files with 95 additions and 51 deletions
+7
View File
@@ -12,6 +12,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};
// For deserialization
use serde::de::{Error as DeError, Visitor};
use std::ops::Deref;
use std::hash::{Hash, Hasher};
#[derive(Clone)]
pub struct Bytes {
@@ -110,6 +111,12 @@ impl Ord for Bytes {
}
}
impl Hash for Bytes {
fn hash<H: Hasher>(&self, state: &mut H) {
state.write(&self.data);
}
}
impl Deref for Bytes {
type Target = Vec<u8>;