Skip to content

Commit 70b4496

Browse files
Fix warning on linux
1 parent af827e5 commit 70b4496

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libproc/proc_pid.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ use self::libc::{c_int, c_void};
4242
// #define MAXPATHLEN PATH_MAX
4343
// in https://opensource.apple.com/source/xnu/xnu-792.25.20/bsd/sys/syslimits.h
4444
// #define PATH_MAX 1024
45+
#[cfg(target_os = "macos")]
4546
const MAXPATHLEN: usize = 1024;
47+
#[cfg(target_os = "macos")]
4648
const PROC_PIDPATHINFO_MAXSIZE: usize = 4 * MAXPATHLEN;
4749

4850
// From http://opensource.apple.com//source/xnu/xnu-1456.1.26/bsd/sys/proc_info.h and
@@ -409,7 +411,7 @@ pub fn name(pid: i32) -> Result<String, String> {
409411
*/
410412
#[cfg(target_os = "linux")]
411413
fn procfile_field(filename: &str, fieldname: &str) -> Result<String, String> {
412-
const SEPARATOR: &'static str = ":";
414+
const SEPARATOR: &str = ":";
413415
let lineheader = format!("{}{}", fieldname, SEPARATOR);
414416

415417
// Open the file in read-only mode (ignoring errors).

0 commit comments

Comments
 (0)