Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion listings/ch12-an-io-project/listing-12-16/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ANCHOR: here
pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> {
pub fn search<'a, 'b>(query: &'a str, contents: &'b str) -> Vec<&'b str> {
vec![]
}
// ANCHOR_END: here
Expand Down
2 changes: 1 addition & 1 deletion listings/ch12-an-io-project/listing-12-17/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ANCHOR: here
pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> {
pub fn search<'a, 'b>(query: &'a str, contents: &'b str) -> Vec<&'b str> {
for line in contents.lines() {
// do something with line
}
Expand Down
2 changes: 1 addition & 1 deletion listings/ch12-an-io-project/listing-12-18/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ANCHOR: here
pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> {
pub fn search<'a, 'b>(query: &'a str, contents: &'b str) -> Vec<&'b str> {
for line in contents.lines() {
if line.contains(query) {
// do something with line
Expand Down
2 changes: 1 addition & 1 deletion listings/ch12-an-io-project/listing-12-19/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ANCHOR: here
// ANCHOR: ch13
pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> {
pub fn search<'a, 'b>(query: &'a str, contents: &'b str) -> Vec<&'b str> {
let mut results = Vec::new();

for line in contents.lines() {
Expand Down