Skip to content

Commit 4afdc24

Browse files
committed
misc: happy clippy happy life
1 parent 0e162f2 commit 4afdc24

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

Cargo.lock

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

bmatcher-core/benches/matcher.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ pub fn simple_binary_pattern(instance: &mut Criterion) {
3939
bencher.iter(|| {
4040
let mut matcher =
4141
BinaryMatcher::new(black_box(&pattern), black_box(&buffer));
42+
43+
#[allow(clippy::never_loop)]
4244
while let Some(_match) = matcher.next_match() {
4345
panic!("pattern should not match");
4446
}
@@ -69,6 +71,8 @@ pub fn simple_binary_pattern(instance: &mut Criterion) {
6971
bencher.iter(|| {
7072
let mut matcher =
7173
BinaryMatcher::new(black_box(&pattern), black_box(&buffer));
74+
75+
#[allow(clippy::never_loop)]
7276
while let Some(_match) = matcher.next_match() {
7377
panic!("pattern should not match");
7478
}

bmatcher-core/src/compiler/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ impl<'a> PatternParser<'a> {
194194
} else {
195195
/* normal byte sequence */
196196
self.atoms.push(Atom::ByteSequence {
197-
seq_start: bytes_start as u16,
198-
seq_end: bytes_end as u16,
197+
seq_start: bytes_start,
198+
seq_end: bytes_end,
199199
});
200200
}
201201

bmatcher-core/src/stack.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ pub trait Stack<T> {
44
fn new() -> Self;
55

66
fn len(&self) -> usize;
7+
fn is_empty(&self) -> bool {
8+
self.len() == 0
9+
}
10+
711
fn reserve(&mut self, _size: usize) {}
812
fn truncate(&mut self, size: usize);
913

example/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ edition.workspace = true
66
publish = false
77

88
[dependencies]
9-
bmatcher = { version = "0.1.0", path = "../bmatcher" }
9+
bmatcher = { version = "*", path = "../bmatcher" }

0 commit comments

Comments
 (0)