Merge pull request #428 from fusepilot/patch-1

Missing search.to_lowercase() in grep_case_insensitive
This commit is contained in:
Carol (Nichols || Goulding) 2017-02-01 18:40:10 -05:00 committed by GitHub
commit d369804c5a

View File

@ -168,6 +168,8 @@ number when we sent you chapter 12, we will fix it. /Carol -->
```rust
fn grep_case_insensitive<'a>(search: &str, contents: &'a str) -> Vec<&'a str> {
let search = search.to_lowercase();
contents.lines()
.filter(|line| {
line.to_lowercase().contains(&search)