A comprehensive collection of reusable TUI components for ratatui including resizable splits, tree views, markdown rendering, toast notifications, dialogs, and terminal embedding
//! Drain pending events without processing.
usestd::sync::mpsc::TryRecvError;usecrate::services::git_watcher::GitWatcher;implGitWatcher{/// Drain all pending events without processing them.
////// This clears the event queue and resets the pending changes flag,
/// useful when you want to ignore accumulated changes
/// (e.g., after a batch operation).
////// # Example
////// ```no_run
/// use ratatui_toolkit::services::git_watcher::GitWatcher;
/// use std::path::Path;
////// let mut watcher = GitWatcher::new().unwrap();
/// watcher.watch(Path::new("/path/to/repo")).unwrap();
////// // After some operation that causes many changes:
/// watcher.drain_events();
/// ```
pubfndrain_events(&mutself){loop{matchself.rx.try_recv(){Ok(_)=>continue,Err(TryRecvError::Empty)=>break,Err(TryRecvError::Disconnected)=>break,}}self.has_pending_changes =false;}}