forked from extern/nushell
Fix clippy lints (#4262)
* Fix clippy lints * Fix clippy lints * Fix clippy lints
This commit is contained in:
@ -93,7 +93,7 @@ pub fn source(args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||
|
||||
let path = canonicalize(source_file).map_err(|e| {
|
||||
ShellError::labeled_error(
|
||||
format!("Can't load source file. Reason: {}", e.to_string()),
|
||||
format!("Can't load source file. Reason: {}", e),
|
||||
"Can't load this file",
|
||||
filename.span(),
|
||||
)
|
||||
@ -112,7 +112,7 @@ pub fn source(args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||
}
|
||||
Err(e) => {
|
||||
ctx.error(ShellError::labeled_error(
|
||||
format!("Can't load source file. Reason: {}", e.to_string()),
|
||||
format!("Can't load source file. Reason: {}", e),
|
||||
"Can't load this file",
|
||||
filename.span(),
|
||||
));
|
||||
|
@ -197,7 +197,7 @@ fn process_row(
|
||||
} else {
|
||||
let mut obj = input.clone();
|
||||
|
||||
for column in column_paths.clone() {
|
||||
for column in column_paths {
|
||||
let path = UntaggedValue::Primitive(Primitive::ColumnPath(column.clone()))
|
||||
.into_value(tag);
|
||||
let data = r.get_data(&as_string(&path)?).borrow().clone();
|
||||
|
@ -104,7 +104,7 @@ fn kill(args: CommandArgs) -> Result<ActionStream, ShellError> {
|
||||
}
|
||||
cmd.arg("-9");
|
||||
} else if let Some(signal_value) = signal {
|
||||
cmd.arg(format!("-{}", signal_value.item().to_string()));
|
||||
cmd.arg(format!("-{}", signal_value.item()));
|
||||
}
|
||||
|
||||
cmd.arg(pid.item().to_string());
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::prelude::*;
|
||||
use nu_errors::ShellError;
|
||||
use nu_protocol::{Signature, TaggedDictBuilder, UntaggedValue};
|
||||
use sysinfo::{ProcessExt, System, SystemExt};
|
||||
use sysinfo::{PidExt, ProcessExt, System, SystemExt};
|
||||
|
||||
pub struct Command;
|
||||
|
||||
@ -50,7 +50,7 @@ fn run_ps(args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||
for pid in result {
|
||||
if let Some(result) = sys.process(pid) {
|
||||
let mut dict = TaggedDictBuilder::new(args.name_tag());
|
||||
dict.insert_untagged("pid", UntaggedValue::int(pid as i64));
|
||||
dict.insert_untagged("pid", UntaggedValue::int(pid.as_u32() as i64));
|
||||
dict.insert_untagged("name", UntaggedValue::string(result.name()));
|
||||
dict.insert_untagged(
|
||||
"status",
|
||||
@ -68,7 +68,7 @@ fn run_ps(args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||
|
||||
if long {
|
||||
if let Some(parent) = result.parent() {
|
||||
dict.insert_untagged("parent", UntaggedValue::int(parent as i64));
|
||||
dict.insert_untagged("parent", UntaggedValue::int(parent.as_u32() as i64));
|
||||
} else {
|
||||
dict.insert_untagged("parent", UntaggedValue::nothing());
|
||||
}
|
||||
|
Reference in New Issue
Block a user