1
0
mirror of https://github.com/jht5945/finding.git synced 2025-12-27 13:20:03 +08:00

use chars

This commit is contained in:
2020-05-02 00:18:56 +08:00
parent e0a85b1368
commit 5b78fa85bc

View File

@@ -92,7 +92,7 @@ fn match_lines(tag: &str, content: &str, options: &Options) -> bool {
for (line_no, ln) in lines.enumerate() {
if options.filter_large_line && ln.len() as u64 >= options.parsed_large_line_size {
if options.verbose {
clear_n_print_message(MessageType::DEBUG, &format!("Skip large line: {} bytes", ln.len()));
clear_n_print_message(MessageType::DEBUG, &format!("Skip large line: {} chars", ln.len()));
}
continue;
}
@@ -106,9 +106,7 @@ fn match_lines(tag: &str, content: &str, options: &Options) -> bool {
}
}
if match_lines_vec.is_empty() {
false
} else {
if !match_lines_vec.is_empty() {
clear_n_print_message(MessageType::OK, &format!("Find in {}:", tag));
for match_line in &match_lines_vec {
print!("{}: ", match_line.line_number + 1);
@@ -125,8 +123,8 @@ fn match_lines(tag: &str, content: &str, options: &Options) -> bool {
println!();
}
}
true
}
!match_lines_vec.is_empty()
}
fn find_text_files(options: &Options, dir_path: &Path) {