(path: &std::path::Path, pattern: &str, results: &mut Vec<SearchResult>)
| 3081 | let mut results = Vec::new(); |
| 3082 | |
| 3083 | fn search_in_file(path: &std::path::Path, pattern: &str, results: &mut Vec<SearchResult>) { |
| 3084 | if let Ok(content) = std::fs::read_to_string(path) { |
| 3085 | for (line_num, line) in content.lines().enumerate() { |
| 3086 | if let Some(col) = line.find(pattern) { |
| 3087 | results.push(SearchResult { |
| 3088 | path: path.to_string_lossy().to_string(), |
| 3089 | line: line_num + 1, |
| 3090 | column: col + 1, |
| 3091 | match_text: line.to_string(), |
| 3092 | }); |
| 3093 | } |
| 3094 | } |
| 3095 | } |
| 3096 | } |
| 3097 | |
| 3098 | fn search_recursive( |
| 3099 | path: &FsPath, |
no test coverage detected