mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-04-26 17:03:43 +02:00
dead code removal
This commit is contained in:
parent
5d17c37b65
commit
3bc77c5b44
1 changed files with 0 additions and 16 deletions
|
@ -6,11 +6,9 @@ use std::str::FromStr;
|
||||||
|
|
||||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||||
|
|
||||||
use zerotier_utils::buffer::Buffer;
|
|
||||||
use zerotier_utils::error::InvalidFormatError;
|
use zerotier_utils::error::InvalidFormatError;
|
||||||
use zerotier_utils::hex;
|
use zerotier_utils::hex;
|
||||||
use zerotier_utils::hex::HEX_CHARS;
|
use zerotier_utils::hex::HEX_CHARS;
|
||||||
use zerotier_utils::marshalable::{Marshalable, UnmarshalError};
|
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
|
@ -56,20 +54,6 @@ impl From<&NetworkId> for u64 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Marshalable for NetworkId {
|
|
||||||
const MAX_MARSHAL_SIZE: usize = 8;
|
|
||||||
|
|
||||||
#[inline(always)]
|
|
||||||
fn marshal<const BL: usize>(&self, buf: &mut Buffer<BL>) -> Result<(), UnmarshalError> {
|
|
||||||
buf.append_u64(self.0.get()).map_err(|_| UnmarshalError::OutOfBounds)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline(always)]
|
|
||||||
fn unmarshal<const BL: usize>(buf: &Buffer<BL>, cursor: &mut usize) -> Result<Self, UnmarshalError> {
|
|
||||||
Self::from_u64(buf.read_u64(cursor)?).ok_or(UnmarshalError::InvalidData)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ToString for NetworkId {
|
impl ToString for NetworkId {
|
||||||
fn to_string(&self) -> String {
|
fn to_string(&self) -> String {
|
||||||
let mut v = self.0.get();
|
let mut v = self.0.get();
|
||||||
|
|
Loading…
Add table
Reference in a new issue