Skip to content

Commit

Permalink
Extract constant for Boolean false
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Soltis committed Sep 7, 2023
1 parent 7dc9c5f commit 86c59ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 5 additions & 1 deletion crates/turborepo-filewatch/src/fsevent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ use std::{
thread,
};

use fs::core_foundation::Boolean;
use fsevent_sys as fs;
use fsevent_sys::core_foundation as cf;
use notify::{
Expand Down Expand Up @@ -281,6 +282,9 @@ extern "C" {
fn CFRunLoopIsWaiting(runloop: cf::CFRunLoopRef) -> cf::Boolean;
}

// CoreFoundation false value
const FALSE: Boolean = 0x0;

impl FsEventWatcher {
fn from_event_handler(event_handler: Arc<Mutex<dyn EventHandler>>) -> Result<Self> {
Ok(FsEventWatcher {
Expand Down Expand Up @@ -480,7 +484,7 @@ impl FsEventWatcher {
cur_runloop,
cf::kCFRunLoopDefaultMode,
);
if fs::FSEventStreamStart(stream) == 0x0 {
if fs::FSEventStreamStart(stream) == FALSE {
panic!("FSEventStream failed to start");
}

Expand Down
6 changes: 1 addition & 5 deletions crates/turborepo-filewatch/src/globwatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,7 @@ mod test {
let cookie_dir = repo_root.join_component(".git");

let watcher = FileSystemWatcher::new(&repo_root).unwrap();
let cookie_jar = CookieJar::new(
&cookie_dir,
Duration::from_secs(2),
watcher.subscribe(),
);
let cookie_jar = CookieJar::new(&cookie_dir, Duration::from_secs(2), watcher.subscribe());

let glob_watcher = GlobWatcher::new(&repo_root, cookie_jar, watcher.subscribe());

Expand Down

0 comments on commit 86c59ee

Please sign in to comment.