This commit is contained in:
veeso
2023-05-09 15:40:21 +02:00
parent 9009002b6e
commit c5eeae74b7
83 changed files with 398 additions and 358 deletions

View File

@@ -2,10 +2,10 @@
//!
//! this module exposes the types to describe a change to sync on the remote file system
use crate::utils::path as path_utils;
use std::path::{Path, PathBuf};
use crate::utils::path as path_utils;
/// Describes an operation on the remote file system to sync
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum FsChange {
@@ -190,10 +190,10 @@ fn remote_relative_path(
#[cfg(test)]
mod test {
use super::*;
use pretty_assertions::assert_eq;
use super::*;
#[test]
fn should_get_remote_relative_path_from_subdir() {
assert_eq!(

View File

@@ -5,19 +5,19 @@
mod change;
// -- export
pub use change::FsChange;
use crate::utils::path as path_utils;
use notify::{
watcher, DebouncedEvent, Error as WatcherError, RecommendedWatcher, RecursiveMode, Watcher,
};
use std::collections::HashMap;
use std::path::{Path, PathBuf};
use std::sync::mpsc::{channel, Receiver, RecvTimeoutError};
use std::time::Duration;
pub use change::FsChange;
use notify::{
watcher, DebouncedEvent, Error as WatcherError, RecommendedWatcher, RecursiveMode, Watcher,
};
use thiserror::Error;
use crate::utils::path as path_utils;
type FsWatcherResult<T> = Result<T, FsWatcherError>;
/// Describes an error returned by the `FsWatcher`
@@ -172,14 +172,13 @@ impl FsWatcher {
#[cfg(test)]
mod test {
use super::*;
#[cfg(target_os = "macos")]
use crate::utils::test_helpers;
use pretty_assertions::assert_eq;
use tempfile::TempDir;
use super::*;
#[cfg(target_os = "macos")]
use crate::utils::test_helpers;
#[test]
fn should_init_fswatcher() {
let watcher = FsWatcher::init(Duration::from_secs(5)).unwrap();