aboutsummaryrefslogtreecommitdiff
path: root/src/modules/search.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/search.rs')
-rw-r--r--src/modules/search.rs27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/modules/search.rs b/src/modules/search.rs
index d5fdc1f..14a0f9e 100644
--- a/src/modules/search.rs
+++ b/src/modules/search.rs
@@ -121,21 +121,18 @@ pub(super) fn module(router: &mut windmark::Router) {
.lines()
.skip(2);
- lines.next().map_or_else(
- String::new,
- |first_line| {
- let mut context_lines = lines.skip_while(|l| {
- !l.to_lowercase().contains(&query.0.to_string())
- });
-
- format!(
- "\n> ... {}\n> {}\n> {} ...",
- first_line,
- context_lines.next().unwrap_or(""),
- context_lines.next().unwrap_or("")
- )
- },
- )
+ lines.next().map_or_else(String::new, |first_line| {
+ let mut context_lines = lines.skip_while(|l| {
+ !l.to_lowercase().contains(&query.0.to_string())
+ });
+
+ format!(
+ "\n> ... {}\n> {}\n> {} ...",
+ first_line,
+ context_lines.next().unwrap_or(""),
+ context_lines.next().unwrap_or("")
+ )
+ })
})
);
}