Skip to content

Commit

Permalink
Update aho-corasick to 1.0 (#1039)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luni-4 authored Apr 21, 2023
1 parent 12fdb03 commit 9b7ead6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description = "Tool to compute and export code metrics"
license = "MPL-2.0"

[dependencies]
aho-corasick = "^0.7"
aho-corasick = "^1.0"
crossbeam = { version = "^0.8", features = ["crossbeam-channel"] }
fxhash = "0.2"
globset = "^0.4"
Expand Down
4 changes: 2 additions & 2 deletions src/checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl Checker for CcommentCode {

fn is_useful_comment(node: &Node, code: &[u8]) -> bool {
lazy_static! {
static ref AC: AhoCorasick = AhoCorasick::new(vec![b"<div rustbindgen"]);
static ref AC: AhoCorasick = AhoCorasick::new(vec![b"<div rustbindgen"]).unwrap();
}
let code = &code[node.object().start_byte()..node.object().end_byte()];
AC.is_match(code)
Expand Down Expand Up @@ -194,7 +194,7 @@ impl Checker for CppCode {

fn is_useful_comment(node: &Node, code: &[u8]) -> bool {
lazy_static! {
static ref AC: AhoCorasick = AhoCorasick::new(vec![b"<div rustbindgen"]);
static ref AC: AhoCorasick = AhoCorasick::new(vec![b"<div rustbindgen"]).unwrap();
}
let code = &code[node.object().start_byte()..node.object().end_byte()];
AC.is_match(code)
Expand Down

0 comments on commit 9b7ead6

Please sign in to comment.