From 8c2d6b796531620f330750e375171450903428fd Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Mon, 14 Aug 2023 13:29:29 -0300 Subject: [PATCH] fix fs [skip ci] --- plugins/fs/src/watcher.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/fs/src/watcher.rs b/plugins/fs/src/watcher.rs index 108698a2..8c2a36fb 100644 --- a/plugins/fs/src/watcher.rs +++ b/plugins/fs/src/watcher.rs @@ -5,7 +5,7 @@ use notify::{Config, Event, RecommendedWatcher, RecursiveMode, Watcher}; use notify_debouncer_mini::{new_debouncer, DebounceEventResult, Debouncer}; use serde::Deserialize; -use tauri::{command, ipc::Channel, Runtime, State}; +use tauri::{command, ipc::Channel, State}; use crate::Result; @@ -30,7 +30,7 @@ enum WatcherKind { Watcher(RecommendedWatcher), } -fn watch_raw(on_event: Channel, rx: Receiver>) { +fn watch_raw(on_event: Channel, rx: Receiver>) { spawn(move || { while let Ok(event) = rx.recv() { if let Ok(event) = event { @@ -41,7 +41,7 @@ fn watch_raw(on_event: Channel, rx: Receiver(on_event: Channel, rx: Receiver) { +fn watch_debounced(on_event: Channel, rx: Receiver) { spawn(move || { while let Ok(event) = rx.recv() { if let Ok(event) = event { @@ -60,12 +60,12 @@ pub struct WatchOptions { } #[command] -pub async fn watch( +pub async fn watch( watchers: State<'_, WatcherCollection>, id: Id, paths: Vec, options: WatchOptions, - on_event: Channel, + on_event: Channel, ) -> Result<()> { let mode = if options.recursive { RecursiveMode::Recursive