ratatui_toolkit/services/git_watcher/constructors/
new.rs

1//! Default constructor for GitWatcher.
2
3use crate::services::git_watcher::{GitWatchConfig, GitWatcher};
4
5impl GitWatcher {
6    /// Create a new git watcher with default configuration.
7    ///
8    /// Uses 100ms debounce by default.
9    ///
10    /// # Errors
11    ///
12    /// Returns a `notify::Error` if the watcher cannot be created.
13    ///
14    /// # Example
15    ///
16    /// ```no_run
17    /// use ratatui_toolkit::services::git_watcher::GitWatcher;
18    ///
19    /// let watcher = GitWatcher::new().unwrap();
20    /// ```
21    pub fn new() -> Result<Self, notify::Error> {
22        Self::with_config(GitWatchConfig::default())
23    }
24}