From cce43b11c13f4cc97e18502c5cd6b197b44a1964 Mon Sep 17 00:00:00 2001 From: Jun Wu Date: Mon, 30 Jul 2018 11:35:36 -0700 Subject: [PATCH] scmdaemon: use io::Write on osx Summary: D9030136 removed the `use` statement and broke OSX build: ``` Compiling scm_daemon v0.1.0 (file:///.../exec/scm_daemon) error[E0599]: no method named `write_fmt` found for type `std::fs::File` in the current scope --> src/main.rs:62:33 | 62 | File::create(path)?.write_fmt(format_args!("{}", std::process::id()))?; | ^^^^^^^^^ | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope, perhaps add a `use` for it: | 14 | use std::io::Write; | ``` Reviewed By: DurhamG, singhsrb Differential Revision: D9066112 fbshipit-source-id: f685b75c4032e8388529f6cf8a9724426bd15baa --- exec/scm_daemon/src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/exec/scm_daemon/src/main.rs b/exec/scm_daemon/src/main.rs index 40da637119..5bfab91144 100644 --- a/exec/scm_daemon/src/main.rs +++ b/exec/scm_daemon/src/main.rs @@ -18,6 +18,9 @@ use commitcloudsubscriber::{CommitCloudConfig, CommitCloudTcpReceiverService, use std::fs::File; use std::io::Read; +#[cfg(target_os = "macos")] +use std::io::Write; + /// This is what we're going to decode toml config into. /// Each field is optional, meaning that it doesn't have to be present in TOML. #[derive(Debug, Deserialize)]