mirror of
https://github.com/nushell/nushell.git
synced 2025-08-17 18:31:11 +02:00
Bump rustyline (#1644)
* Bump rustyline * Fix new clippy warnings * Add pipeline command
This commit is contained in:
@ -64,7 +64,7 @@ query_interface = "0.3.5"
|
||||
rand = "0.7"
|
||||
regex = "1"
|
||||
roxmltree = "0.10.1"
|
||||
rustyline = "6.1.1"
|
||||
rustyline = "6.1.2"
|
||||
serde = { version = "1.0.106", features = ["derive"] }
|
||||
serde-hjson = "0.9.1"
|
||||
serde_bytes = "0.11.3"
|
||||
|
@ -110,30 +110,24 @@ pub fn compare_values(
|
||||
left: &UntaggedValue,
|
||||
right: &UntaggedValue,
|
||||
) -> Result<bool, (&'static str, &'static str)> {
|
||||
match operator {
|
||||
_ => {
|
||||
let coerced = coerce_compare(left, right)?;
|
||||
let ordering = coerced.compare();
|
||||
let coerced = coerce_compare(left, right)?;
|
||||
let ordering = coerced.compare();
|
||||
|
||||
use std::cmp::Ordering;
|
||||
use std::cmp::Ordering;
|
||||
|
||||
let result = match (operator, ordering) {
|
||||
(Operator::Equal, Ordering::Equal) => true,
|
||||
(Operator::NotEqual, Ordering::Less) | (Operator::NotEqual, Ordering::Greater) => {
|
||||
true
|
||||
}
|
||||
(Operator::LessThan, Ordering::Less) => true,
|
||||
(Operator::GreaterThan, Ordering::Greater) => true,
|
||||
(Operator::GreaterThanOrEqual, Ordering::Greater)
|
||||
| (Operator::GreaterThanOrEqual, Ordering::Equal) => true,
|
||||
(Operator::LessThanOrEqual, Ordering::Less)
|
||||
| (Operator::LessThanOrEqual, Ordering::Equal) => true,
|
||||
_ => false,
|
||||
};
|
||||
let result = match (operator, ordering) {
|
||||
(Operator::Equal, Ordering::Equal) => true,
|
||||
(Operator::NotEqual, Ordering::Less) | (Operator::NotEqual, Ordering::Greater) => true,
|
||||
(Operator::LessThan, Ordering::Less) => true,
|
||||
(Operator::GreaterThan, Ordering::Greater) => true,
|
||||
(Operator::GreaterThanOrEqual, Ordering::Greater)
|
||||
| (Operator::GreaterThanOrEqual, Ordering::Equal) => true,
|
||||
(Operator::LessThanOrEqual, Ordering::Less)
|
||||
| (Operator::LessThanOrEqual, Ordering::Equal) => true,
|
||||
_ => false,
|
||||
};
|
||||
|
||||
Ok(result)
|
||||
}
|
||||
}
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
pub fn format_type<'a>(value: impl Into<&'a UntaggedValue>, width: usize) -> String {
|
||||
|
@ -204,12 +204,9 @@ impl Shell for HelpShell {
|
||||
let mut possible_completion = vec![];
|
||||
let commands = self.commands();
|
||||
for cmd in commands {
|
||||
match cmd {
|
||||
Value { value, .. } => {
|
||||
for desc in value.data_descriptors() {
|
||||
possible_completion.push(desc);
|
||||
}
|
||||
}
|
||||
let Value { value, .. } = cmd;
|
||||
for desc in value.data_descriptors() {
|
||||
possible_completion.push(desc);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -238,12 +238,9 @@ impl Shell for ValueShell {
|
||||
let mut possible_completion = vec![];
|
||||
let members = self.members();
|
||||
for member in members {
|
||||
match member {
|
||||
Value { value, .. } => {
|
||||
for desc in value.data_descriptors() {
|
||||
possible_completion.push(desc);
|
||||
}
|
||||
}
|
||||
let Value { value, .. } = member;
|
||||
for desc in value.data_descriptors() {
|
||||
possible_completion.push(desc);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user