From af8c5bb31a3711ee31b72b1d5cb31c4dab349dce Mon Sep 17 00:00:00 2001 From: debris Date: Tue, 1 Aug 2017 15:06:30 +0200 Subject: [PATCH] fix for util on linux --- util/src/kvdb.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/src/kvdb.rs b/util/src/kvdb.rs index c231e682d..e6568d68c 100644 --- a/util/src/kvdb.rs +++ b/util/src/kvdb.rs @@ -304,6 +304,7 @@ impl Default for CompactionProfile { /// Given output of df command return Linux rotational flag file path. #[cfg(target_os = "linux")] pub fn rotational_from_df_output(df_out: Vec) -> Option { + use std::str; str::from_utf8(df_out.as_slice()) .ok() // Get the drive name. @@ -324,6 +325,7 @@ impl CompactionProfile { /// Attempt to determine the best profile automatically, only Linux for now. #[cfg(target_os = "linux")] pub fn auto(db_path: &Path) -> CompactionProfile { + use std::io::Read; let hdd_check_file = db_path .to_str() .and_then(|path_str| Command::new("df").arg(path_str).output().ok())