mirror of
https://github.com/nushell/nushell.git
synced 2025-08-14 15:28:53 +02:00
Fix latest clippy warnings (#3049)
This commit is contained in:
@ -209,10 +209,8 @@ impl Block {
|
||||
pub fn set_redirect(&mut self, external_redirection: ExternalRedirection) {
|
||||
if let Some(group) = self.block.last_mut() {
|
||||
if let Some(pipeline) = group.pipelines.last_mut() {
|
||||
if let Some(command) = pipeline.list.last_mut() {
|
||||
if let ClassifiedCommand::Internal(internal) = command {
|
||||
internal.args.external_redirection = external_redirection;
|
||||
}
|
||||
if let Some(ClassifiedCommand::Internal(internal)) = pipeline.list.last_mut() {
|
||||
internal.args.external_redirection = external_redirection;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -389,20 +389,20 @@ pub enum Column {
|
||||
Value,
|
||||
}
|
||||
|
||||
impl Into<Column> for String {
|
||||
fn into(self) -> Column {
|
||||
Column::String(self)
|
||||
impl From<String> for Column {
|
||||
fn from(x: String) -> Self {
|
||||
Column::String(x)
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<Column> for &String {
|
||||
fn into(self) -> Column {
|
||||
Column::String(self.clone())
|
||||
impl From<&String> for Column {
|
||||
fn from(x: &String) -> Self {
|
||||
Column::String(x.clone())
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<Column> for &str {
|
||||
fn into(self) -> Column {
|
||||
Column::String(self.to_string())
|
||||
impl From<&str> for Column {
|
||||
fn from(x: &str) -> Self {
|
||||
Column::String(x.to_string())
|
||||
}
|
||||
}
|
||||
|
@ -561,9 +561,9 @@ impl From<Value> for UntaggedValue {
|
||||
}
|
||||
|
||||
/// Convert a borrowed Value into a borrowed UntaggedValue
|
||||
impl<'a> Into<&'a UntaggedValue> for &'a Value {
|
||||
fn into(self) -> &'a UntaggedValue {
|
||||
&self.value
|
||||
impl<'a> From<&'a Value> for &'a UntaggedValue {
|
||||
fn from(x: &'a Value) -> Self {
|
||||
&x.value
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,6 @@ where
|
||||
D: serde::Deserializer<'de>,
|
||||
{
|
||||
let x: String = serde::Deserialize::deserialize(deserializer)?;
|
||||
Ok(BigDecimal::parse_bytes(x.as_bytes(), 10)
|
||||
.ok_or_else(|| serde::de::Error::custom("expected a bigdecimal"))?)
|
||||
BigDecimal::parse_bytes(x.as_bytes(), 10)
|
||||
.ok_or_else(|| serde::de::Error::custom("expected a bigdecimal"))
|
||||
}
|
||||
|
@ -15,6 +15,6 @@ where
|
||||
{
|
||||
let x: String = serde::Deserialize::deserialize(deserializer)?;
|
||||
|
||||
Ok(BigInt::parse_bytes(x.as_bytes(), 10)
|
||||
.ok_or_else(|| serde::de::Error::custom("expected a bignum"))?)
|
||||
BigInt::parse_bytes(x.as_bytes(), 10)
|
||||
.ok_or_else(|| serde::de::Error::custom("expected a bignum"))
|
||||
}
|
||||
|
Reference in New Issue
Block a user