fix cargo doctest
Closes:
@@ -31,6 +31,8 @@ const MAX_BUCKETS: usize = 32;
/// * A position can set more than once -- it remains set after the first time.
///
/// # Examples:
+/// ```
+/// use diem_bitvec::BitVec;
/// let mut bv = BitVec::default();
/// bv.set(2);
/// bv.set(5);
@@ -38,7 +40,7 @@ const MAX_BUCKETS: usize = 32;
/// assert!(bv.is_set(5));
/// assert_eq!(false, bv.is_set(0));
/// assert_eq!(bv.count_ones(), 2);
-/// assert_eq!(bv.last_set_bit(), 5);
+/// assert_eq!(bv.last_set_bit(), Some(5));
///
/// // A bitwise AND of BitVec can be performed by using the `&` operator.
/// let mut bv1 = BitVec::default();
@@ -214,7 +216,9 @@ mod test {
assert_eq!(p5.last_set_bit(), Some(10));
assert_eq!(p5.inner, vec![0b0000_0001, 0b0110_0000]);
- let p6 = BitVec { inner: vec![128u8] };
+ let p6 = BitVec {
+ inner: vec![0b1000_0000],
+ };
assert_eq!(p6.inner.len(), 1);
assert_eq!(p6.last_set_bit(), Some(0));
}
