@@ -16,7 +16,7 @@ use super::scanner;
1616use super :: store:: { self , IndexStore } ;
1717use super :: watcher;
1818use super :: writer:: { IndexWriter , WriteMessage } ;
19- use crate :: pluralize:: { pluralize, pluralize_with } ;
19+ use crate :: pluralize:: pluralize;
2020
2121// ── Live event loop ──────────────────────────────────────────────────
2222
@@ -216,8 +216,9 @@ pub(super) async fn run_live_event_loop(
216216 & volume_id,
217217 RescanReason :: WatcherChannelOverflow ,
218218 format!(
219- "The filesystem watcher's event channel overflowed after \
220- {event_count} live events. Some file changes were lost."
219+ "The filesystem watcher's event channel overflowed after {}. \
220+ Some file changes were lost.",
221+ pluralize( event_count, "live event" )
221222 ) ,
222223 ) ;
223224 // Drain and discard remaining events: they're a partial
@@ -719,9 +720,9 @@ pub(super) async fn run_replay_event_loop(
719720 // ── Phase 2: After HistoryDone ───────────────────────────────────
720721
721722 if deduped_total < event_count {
723+ // allowed-pluralize-noun: dedup only kicks in when event_count >= 2.
722724 log:: info!(
723- "Replay: deduplicated {event_count} raw events to {deduped_total} unique \
724- ({:.0}% reduction)",
725+ "Replay: deduplicated {event_count} raw events to {deduped_total} unique ({:.0}% reduction)" ,
725726 ( 1.0 - deduped_total as f64 / event_count. max( 1 ) as f64 ) * 100.0 ,
726727 ) ;
727728 }
@@ -827,9 +828,9 @@ pub(super) async fn run_replay_event_loop(
827828 & volume_id,
828829 RescanReason :: TooManySubdirRescans ,
829830 format ! (
830- "Replay accumulated more than {} needing full \
831- rescans. This typically means a major filesystem reorganization happened." ,
832- pluralize_with ( MAX_PENDING_RESCANS as u64 , "directory" , "directories" )
831+ // allowed-pluralize-noun: MAX_PENDING_RESCANS is the const 1_000.
832+ "Replay accumulated more than {MAX_PENDING_RESCANS} directories needing full \
833+ rescans. This typically means a major filesystem reorganization happened."
833834 ) ,
834835 ) ;
835836 if let Some ( tx) = fallback_tx. take ( ) {
@@ -894,9 +895,10 @@ pub(super) async fn run_replay_event_loop(
894895 & volume_id,
895896 RescanReason :: WatcherChannelOverflow ,
896897 format!(
897- "The filesystem watcher's event channel overflowed after \
898- {event_count} replay + {live_count} live events. Some file \
899- changes were lost."
898+ "The filesystem watcher's event channel overflowed after {} + {}. \
899+ Some file changes were lost.",
900+ pluralize( event_count, "replay event" ) ,
901+ pluralize( live_count, "live event" ) ,
900902 ) ,
901903 ) ;
902904 if let Some ( tx) = fallback_tx. take( ) {
@@ -918,7 +920,11 @@ pub(super) async fn run_replay_event_loop(
918920 }
919921 }
920922
921- log:: info!( "Replay event loop: stopped ({event_count} replay + {live_count} live events)" ) ;
923+ log:: info!(
924+ "Replay event loop: stopped ({} + {})" ,
925+ pluralize( event_count, "replay event" ) ,
926+ pluralize( live_count, "live event" ) ,
927+ ) ;
922928 Ok ( ( ) )
923929}
924930
@@ -1247,10 +1253,10 @@ fn verify_affected_dirs(affected_paths: &HashSet<String>, writer: &IndexWriter)
12471253
12481254 if stale_count > 0 || new_file_count > 0 || !new_dir_paths. is_empty ( ) {
12491255 log:: debug!(
1250- "Replay verification: {stale_count} stale, {new_file_count} new files, \
1251- {} new dirs across {} affected dirs" ,
1252- new_dir_paths. len( ) ,
1253- affected_paths. len( ) ,
1256+ "Replay verification: {stale_count} stale, {}, {} across {}" ,
1257+ pluralize ( new_file_count , " new file" ) ,
1258+ pluralize ( new_dir_paths. len( ) as u64 , "new dir" ) ,
1259+ pluralize ( affected_paths. len( ) as u64 , "affected dir" ) ,
12541260 ) ;
12551261 }
12561262
0 commit comments