Skip to content

Commit 3dc4786

Browse files
committed
Deprecate BStr and BString
1 parent 14844f1 commit 3dc4786

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/trie.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use key::{AsKey, Break};
99
use node::{Leaf, Node};
1010
use subtrie::SubTrie;
1111
use util::nybble_mismatch;
12+
#[allow(deprecated)]
1213
use wrapper::{BStr, BString};
1314

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

357+
#[allow(deprecated)]
356358
impl<V> Trie<BString, V> {
357359
/// Convenience function for iterating over suffixes with a string.
358360
pub fn iter_prefix_str<'a, Q: ?Sized>(&self, key: &'a Q) -> Iter<BString, V>

src/wrapper.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(deprecated)]
2+
13
use std::borrow::Borrow;
24
use std::fmt;
35
use std::hash::{Hash, Hasher};
@@ -8,6 +10,7 @@ use key::AsKey;
810
/// A wrapper for `String` which implements `Borrow<[u8]>` and hashes in the same way as a byte
911
/// slice.
1012
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13+
#[deprecated(since = "0.8.0", note = "use a plain `String` instead")]
1114
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
1215
pub struct BString(String);
1316

@@ -96,6 +99,7 @@ impl Hash for BString {
9699

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

tests/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(deprecated)]
2+
13
extern crate rand;
24
#[macro_use]
35
extern crate quickcheck;

0 commit comments

Comments
 (0)