Skip to content

Commit b75b0ac

Browse files
committed
Add a few comments
1 parent 31b9d09 commit b75b0ac

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/main/java/engineering/swat/watch/impl/mac/NativeEventHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static Path toContext(String rootPath, String relativePath) {
8383
}
8484
}
8585

86-
enum Kind {
86+
enum Kind { // Order of values needs to be consistent with enum `Kind` in Rust
8787
OVERFLOW,
8888
CREATE,
8989
DELETE,

src/main/rust/src/fs_monitor.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ extern "C" fn callback(
119119

120120
let event_paths = event_paths as *const *const c_char;
121121
for i in 0..num_events {
122+
// TODO: We're currently going from C strings to Rust strings to JNI
123+
// strings. If possible, go directly from C strings to JNI strings.
122124
let path = unsafe { CStr::from_ptr(*event_paths.add(i)).to_str().unwrap().to_string() };
123125
let flags: fse::FSEventStreamEventFlags = unsafe { *event_flags.add(i) };
124126

0 commit comments

Comments
 (0)