mirror of
https://github.com/nushell/nushell
synced 2024-12-27 05:23:11 +00:00
Eliminate some compiler warnings (#1468)
- Unnecessary parentheses - Deprecated `description()` method
This commit is contained in:
parent
e440d8c939
commit
755d0e648b
3 changed files with 5 additions and 6 deletions
|
@ -680,8 +680,8 @@ fn argument_is_quoted(argument: &str) -> bool {
|
|||
return false;
|
||||
}
|
||||
|
||||
((argument.starts_with('"') && argument.ends_with('"'))
|
||||
|| (argument.starts_with('\'') && argument.ends_with('\'')))
|
||||
(argument.starts_with('"') && argument.ends_with('"'))
|
||||
|| (argument.starts_with('\'') && argument.ends_with('\''))
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
|
|
|
@ -2,7 +2,6 @@ use crate::prelude::*;
|
|||
use nu_errors::ShellError;
|
||||
use nu_protocol::{CallInfo, Signature, SyntaxShape, Value};
|
||||
use nu_source::Tagged;
|
||||
use std::error::Error;
|
||||
use std::fs::OpenOptions;
|
||||
use std::path::PathBuf;
|
||||
|
||||
|
@ -48,7 +47,7 @@ fn touch(args: TouchArgs, _context: &RunnablePerItemContext) -> Result<OutputStr
|
|||
Ok(_) => Ok(OutputStream::empty()),
|
||||
Err(err) => Err(ShellError::labeled_error(
|
||||
"File Error",
|
||||
err.description(),
|
||||
err.to_string(),
|
||||
&args.target.tag,
|
||||
)),
|
||||
}
|
||||
|
|
|
@ -301,10 +301,10 @@ struct DebugEntry<'a> {
|
|||
impl<'a> PrettyDebug for DebugEntry<'a> {
|
||||
/// Prepare debug entries for pretty-printing
|
||||
fn pretty(&self) -> DebugDocBuilder {
|
||||
(b::key(match self.key {
|
||||
b::key(match self.key {
|
||||
Column::String(string) => string.clone(),
|
||||
Column::Value => "<value>".to_string(),
|
||||
}) + b::delimit("(", self.value.pretty(), ")").into_kind())
|
||||
}) + b::delimit("(", self.value.pretty(), ")").into_kind()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue