Skip to content

Commit

Permalink
refactor(prefix-map): remove the requirement of Borrow<Prefix> trait …
Browse files Browse the repository at this point in the history
…for T from PrefixMap

BREAKING CHANGE:
 - Expose PrefixMap as public from lib and remove pub prefix_map mod.
 - Adapting PrefixMap APIs to the removal of requirement of Borrow<Prefix> Trait for T.
  • Loading branch information
bochaco committed Aug 10, 2021
1 parent 7e9c25a commit 1e32830
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 105 deletions.
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@

use core::{cmp::Ordering, fmt, ops};
pub use prefix::Prefix;
pub use prefix_map::PrefixMap;
use rand::{
distributions::{Distribution, Standard},
rngs::OsRng,
Expand Down Expand Up @@ -95,7 +96,7 @@ macro_rules! format {
}

mod prefix;
pub mod prefix_map;
mod prefix_map;

/// Constant byte length of `XorName`.
pub const XOR_NAME_LEN: usize = 32;
Expand Down
7 changes: 0 additions & 7 deletions src/prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

use crate::{XorName, XOR_NAME_LEN};
use core::{
borrow::Borrow,
cmp::{self, Ordering},
fmt::{Binary, Debug, Display, Formatter, Result as FmtResult},
hash::{Hash, Hasher},
Expand Down Expand Up @@ -281,12 +280,6 @@ impl Debug for Prefix {
}
}

impl<T> Borrow<Prefix> for (Prefix, T) {
fn borrow(&self) -> &Prefix {
&self.0
}
}

#[derive(Debug)]
pub struct FromStrError {
pub invalid_char: char,
Expand Down

0 comments on commit 1e32830

Please sign in to comment.