Skip to content

Commit

Permalink
Deprecate BStr and BString
Browse files Browse the repository at this point in the history
  • Loading branch information
tapeinosyne committed Oct 16, 2020
1 parent 14844f1 commit 3dc4786
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use key::{AsKey, Break};
use node::{Leaf, Node};
use subtrie::SubTrie;
use util::nybble_mismatch;
#[allow(deprecated)]
use wrapper::{BStr, BString};

/// A QP-trie. QP stands for - depending on who you ask - either "quelques-bits popcount" or
Expand Down Expand Up @@ -353,6 +354,7 @@ where
}
}

#[allow(deprecated)]
impl<V> Trie<BString, V> {
/// Convenience function for iterating over suffixes with a string.
pub fn iter_prefix_str<'a, Q: ?Sized>(&self, key: &'a Q) -> Iter<BString, V>
Expand Down
4 changes: 4 additions & 0 deletions src/wrapper.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(deprecated)]

use std::borrow::Borrow;
use std::fmt;
use std::hash::{Hash, Hasher};
Expand All @@ -8,6 +10,7 @@ use key::AsKey;
/// A wrapper for `String` which implements `Borrow<[u8]>` and hashes in the same way as a byte
/// slice.
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[deprecated(since = "0.8.0", note = "use a plain `String` instead")]
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct BString(String);

Expand Down Expand Up @@ -96,6 +99,7 @@ impl Hash for BString {

/// A wrapper type for `str` which implements `Borrow<[u8]>` and hashes in the same way as a byte
/// slice.
#[deprecated(since = "0.8.0", note = "use a plain `str` instead")]
#[derive(PartialEq, Eq, PartialOrd, Ord)]
pub struct BStr(str);

Expand Down
2 changes: 2 additions & 0 deletions tests/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(deprecated)]

extern crate rand;
#[macro_use]
extern crate quickcheck;
Expand Down

0 comments on commit 3dc4786

Please sign in to comment.