Skip to content

Commit ac3c3e7

Browse files
jeremystuckiBurntSushi
authored andcommitted
style: use is_empty
1 parent df0e09e commit ac3c3e7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/compile.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl Compiler {
110110
/// specified size limit. If the size limit is exceeded, then compilation
111111
/// stops and returns an error.
112112
pub fn compile(mut self, exprs: &[Hir]) -> result::Result<Program, Error> {
113-
debug_assert!(exprs.len() >= 1);
113+
debug_assert!(!exprs.is_empty());
114114
self.num_exprs = exprs.len();
115115
if exprs.len() == 1 {
116116
self.compile_one(&exprs[0])

src/literal/imp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ impl BoyerMooreSearch {
570570
/// Create a new string searcher, performing whatever
571571
/// compilation steps are required.
572572
fn new(pattern: Vec<u8>) -> Self {
573-
debug_assert!(pattern.len() > 0);
573+
debug_assert!(!pattern.is_empty());
574574

575575
let (g, gi) = Self::select_guard(pattern.as_slice());
576576
let skip_table = Self::compile_skip_table(pattern.as_slice());

0 commit comments

Comments
 (0)