Skip to content

Commit

Permalink
refactor: simplify regex in package parsers
Browse files Browse the repository at this point in the history
Signed-off-by: Luke-zhang-04 <luke.zhang2004dev@gmail.com>
  • Loading branch information
Luke-zhang-04 committed Nov 5, 2020
1 parent 9311d49 commit a19ced8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/onefetch/deps/package_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn npm(contents: &str) -> Result<usize> {
}

pub fn pip(contents: &str) -> Result<usize> {
let count = Regex::new(r"(^[A-z]+)|(\n[A-z]+)")?.find_iter(contents).count();
let count = Regex::new(r"(^|\n)[A-z]+")?.find_iter(contents).count();

Ok(count)
}

0 comments on commit a19ced8

Please sign in to comment.