mirror of
https://github.com/fanzeyi/cargo-play
synced 2024-11-12 22:17:06 +00:00
Update parsing for package declarations (#9)
Use `filter` instead of `take_while` to find all cargo-play declarations.
This commit is contained in:
parent
3d1f7c81ef
commit
21d51d5b2e
1 changed files with 1 additions and 1 deletions
|
@ -36,7 +36,7 @@ fn extract_headers(files: &Vec<String>) -> Vec<String> {
|
|||
.iter()
|
||||
.map(|file: &String| -> Vec<String> {
|
||||
file.lines()
|
||||
.take_while(|line| line.starts_with("//#"))
|
||||
.filter(|line| line.starts_with("//#"))
|
||||
.map(|line| line[3..].trim_start().into())
|
||||
.filter(|s: &String| !s.is_empty())
|
||||
.collect()
|
||||
|
|
Loading…
Reference in a new issue