fix fs [skip ci]

pull/555/head
Lucas Nogueira 2 years ago
parent f19260cbb2
commit 8c2d6b7965
No known key found for this signature in database
GPG Key ID: FFEA6C72E73482F1

@ -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<R: Runtime>(on_event: Channel<R>, rx: Receiver<notify::Result<Event>>) {
fn watch_raw(on_event: Channel, rx: Receiver<notify::Result<Event>>) {
spawn(move || {
while let Ok(event) = rx.recv() {
if let Ok(event) = event {
@ -41,7 +41,7 @@ fn watch_raw<R: Runtime>(on_event: Channel<R>, rx: Receiver<notify::Result<Event
});
}
fn watch_debounced<R: Runtime>(on_event: Channel<R>, rx: Receiver<DebounceEventResult>) {
fn watch_debounced(on_event: Channel, rx: Receiver<DebounceEventResult>) {
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<R: Runtime>(
pub async fn watch(
watchers: State<'_, WatcherCollection>,
id: Id,
paths: Vec<PathBuf>,
options: WatchOptions,
on_event: Channel<R>,
on_event: Channel,
) -> Result<()> {
let mode = if options.recursive {
RecursiveMode::Recursive

Loading…
Cancel
Save