Skip to content

Commit 277899f

Browse files
committed
add peek
1 parent b212c55 commit 277899f

File tree

4 files changed

+233
-11
lines changed

4 files changed

+233
-11
lines changed

Cargo.lock

Lines changed: 14 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ members = ["algorithm-macro"]
33

44
[package]
55
name = "algorithm"
6-
version = "0.1.7"
6+
version = "0.1.9"
77
edition = "2021"
88
authors = ["tickbh <tickdream125@hotmail.com>"]
99
description = "about algorithm data structure, now has ttl with lru/lru-k/lfu/arc and slab/rbtree/roaring_bitmap/timer_wheelss, 关于算法常用的数据结构"
@@ -19,7 +19,8 @@ hashbrown="0.14"
1919
log="0.4.22"
2020

2121
[dependencies.algorithm-macro]
22-
path = "algorithm-macro"
22+
# path = "algorithm-macro"
23+
version = "0.1"
2324

2425
[dev-dependencies]
2526
rand="0.8.5"

src/buf/binary_mut.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,10 @@ impl Bt for BinaryMut {
333333
self.as_slice()
334334
}
335335

336+
fn advance(&mut self, n: usize) {
337+
self.inc_start(n);
338+
}
339+
336340
fn advance_chunk(&mut self, n: usize) -> &[u8] {
337341
let cursor = self.cursor;
338342
self.inc_start(n);
@@ -343,10 +347,6 @@ impl Bt for BinaryMut {
343347
ret
344348
}
345349

346-
fn advance(&mut self, n: usize) {
347-
self.inc_start(n);
348-
}
349-
350350
fn into_binary(self) -> Binary {
351351
Binary::from(self.chunk().to_vec())
352352
}

0 commit comments

Comments
 (0)