Skip to content

Commit

Permalink
Reimplement Name using a pair of SmallVec, remove Index impls
Browse files Browse the repository at this point in the history
  • Loading branch information
saethlin committed Mar 3, 2021
1 parent 11aaca3 commit 4d29b04
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 89 deletions.
11 changes: 1 addition & 10 deletions crates/client/src/rr/lower_name.rs
Expand Up @@ -11,14 +11,13 @@ use std::borrow::Borrow;
use std::cmp::{Ordering, PartialEq};
use std::fmt;
use std::hash::{Hash, Hasher};
use std::ops::Index;
use std::str::FromStr;

use crate::proto::error::*;
#[cfg(feature = "serde-config")]
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};

use crate::rr::{Label, Name};
use crate::rr::Name;
use crate::serialize::binary::*;

/// them should be through references. As a workaround the Strings are all Rc as well as the array
Expand Down Expand Up @@ -191,14 +190,6 @@ impl fmt::Display for LowerName {
}
}

impl Index<usize> for LowerName {
type Output = Label;

fn index(&self, _index: usize) -> &Label {
&(self.0[_index])
}
}

impl PartialOrd<LowerName> for LowerName {
fn partial_cmp(&self, other: &LowerName) -> Option<Ordering> {
Some(self.cmp(other))
Expand Down

0 comments on commit 4d29b04

Please sign in to comment.