summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/ops/fs_events.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/runtime/ops/fs_events.rs b/runtime/ops/fs_events.rs
index 30c6d3aaa..26ad255fd 100644
--- a/runtime/ops/fs_events.rs
+++ b/runtime/ops/fs_events.rs
@@ -65,8 +65,9 @@ impl Resource for FsEventsResource {
/// the complexity.
#[derive(Serialize, Debug)]
struct FsEvent {
- kind: String,
+ kind: &'static str,
paths: Vec<PathBuf>,
+ flag: Option<&'static str>,
}
impl From<NotifyEvent> for FsEvent {
@@ -77,12 +78,15 @@ impl From<NotifyEvent> for FsEvent {
EventKind::Create(_) => "create",
EventKind::Modify(_) => "modify",
EventKind::Remove(_) => "remove",
- EventKind::Other => todo!(), // What's this for? Leaving it out for now.
- }
- .to_string();
+ EventKind::Other => "other",
+ };
+ let flag = e.flag().map(|f| match f {
+ notify::event::Flag::Rescan => "rescan",
+ });
FsEvent {
kind,
paths: e.paths,
+ flag,
}
}
}