Eliminate some compiler warnings (#1468)

- Unnecessary parentheses
- Deprecated `description()` method
This commit is contained in:
Jason Gedge 2020-03-08 15:19:07 -04:00 committed by GitHub
parent e440d8c939
commit 755d0e648b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 6 deletions

View File

@ -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)]

View File

@ -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,
)),
}

View File

@ -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()
}
}