Add a code for performing the actual search

This commit is contained in:
Manuel Thalmann 2025-03-20 23:10:31 +01:00
parent 1a18cdbf52
commit e9e4c403e6
Signed by: manuth
SSH key fingerprint: SHA256:HsMLC+7kJWALP6YCYCoopxNbUnghwSGLVcG76SECT5c

View file

@ -25,7 +25,15 @@ pub fn run(config: Config) -> Result<(), Box<dyn Error>> {
}
pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> {
vec![]
let mut results = Vec::new();
for line in contents.lines() {
if line.contains(query) {
results.push(line);
}
}
results
}
#[cfg(test)]