From 0a439fe52f51083c7be640f90376b98a1d650a53 Mon Sep 17 00:00:00 2001 From: Chris Gillespie <6572184+gillespiecd@users.noreply.github.com> Date: Thu, 24 Sep 2020 20:44:59 -0700 Subject: [PATCH] Removed unused files in nu-data (#2598) --- crates/nu-data/src/operators.rs | 0 crates/nu-data/src/process.rs | 29 ----------------------------- 2 files changed, 29 deletions(-) delete mode 100644 crates/nu-data/src/operators.rs delete mode 100644 crates/nu-data/src/process.rs diff --git a/crates/nu-data/src/operators.rs b/crates/nu-data/src/operators.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/crates/nu-data/src/process.rs b/crates/nu-data/src/process.rs deleted file mode 100644 index e87c26f3b4..0000000000 --- a/crates/nu-data/src/process.rs +++ /dev/null @@ -1,29 +0,0 @@ -use nu_data::{TaggedDictBuilder, Value}; -use crate::prelude::*; -use itertools::join; -use sysinfo::ProcessExt; - -pub(crate) fn process_dict(proc: &sysinfo::Process, tag: impl Into) -> Value { - let mut dict = TaggedDictBuilder::new(tag); - - let cmd = proc.cmd(); - - let cmd_value = if cmd.len() == 0 { - value::nothing() - } else { - value::string(join(cmd, "")) - }; - - dict.insert("pid", value::int(proc.pid() as i64)); - dict.insert("status", value::string(proc.status().to_string())); - dict.insert("cpu", value::number(proc.cpu_usage())); - - match cmd_value { - UntaggedValue::Primitive(Primitive::Nothing) => { - dict.insert("name", value::string(proc.name())); - } - _ => dict.insert("name", cmd_value), - } - - dict.into_value() -}