clippy

a6738cc · gmorell · 2025-07-25 16:40

2 files +4 -5

Files changed

modified src/main.rs
+4 −5
@@ -238,7 +238,7 @@ impl MarkPrompter {
238 238 let mut content = String::new();
239 239 let mut found_closing = false;
240 240
241 − while let Some(inner_ch) = chars.next() {
241 + for inner_ch in chars.by_ref() {
242 242 if inner_ch == ch {
243 243 found_closing = true;
244 244 break;
@@ -290,7 +290,7 @@ impl MarkPrompter {
290 290 let mut content = String::new();
291 291 let mut found_closing = false;
292 292
293 − while let Some(inner_ch) = chars.next() {
293 + for inner_ch in chars.by_ref() {
294 294 if inner_ch == '`' {
295 295 found_closing = true;
296 296 break;
@@ -364,8 +364,7 @@ impl MarkPrompter {
364 364 thread::spawn(move || {
365 365 let mut last_modified = fs::metadata(&path_clone)
366 366 .ok()
367 − .map(|m| m.modified().ok())
368 − .flatten();
367 + .and_then(|m| m.modified().ok());
369 368
370 369 loop {
371 370 thread::sleep(Duration::from_secs(1));
@@ -726,7 +725,7 @@ impl App for MarkPrompter {
726 725 .spacing([0.0, 5.0])
727 726 .striped(false)
728 727 .show(ui, |ui| {
729 − for (_i, line) in lines.iter().enumerate() {
728 + for line in lines.iter() {
730 729 let trimmed = line.trim();
731 730
732 731 // Detect heading level and extract text without #

Parents: f285279