1
0
mirror of https://github.com/nushell/nushell.git synced 2025-04-03 22:20:48 +02:00

bump rust-toolchain to 1.64 ()

* bump rust-toolchain to 1.64

* 1.64 clippy
This commit is contained in:
Darren Schroeder 2022-11-04 10:27:23 -05:00 committed by GitHub
parent ca9bf19041
commit bb968304da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 27 additions and 27 deletions

View File

@ -63,7 +63,7 @@ impl Command for BytesAdd {
) -> Result<PipelineData, ShellError> { ) -> Result<PipelineData, ShellError> {
let added_data: Vec<u8> = call.req(engine_state, stack, 0)?; let added_data: Vec<u8> = call.req(engine_state, stack, 0)?;
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let index: Option<usize> = call.get_flag(engine_state, stack, "index")?; let index: Option<usize> = call.get_flag(engine_state, stack, "index")?;
let end = call.has_flag("end"); let end = call.has_flag("end");

View File

@ -142,7 +142,7 @@ impl Command for BytesAt {
let range: Value = call.req(engine_state, stack, 0)?; let range: Value = call.req(engine_state, stack, 0)?;
let (start, end, arg_span) = parse_range(range, call.head)?; let (start, end, arg_span) = parse_range(range, call.head)?;
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let arg = Arguments { let arg = Arguments {
start, start,
end, end,

View File

@ -54,7 +54,7 @@ impl Command for BytesEndsWith {
) -> Result<PipelineData, ShellError> { ) -> Result<PipelineData, ShellError> {
let pattern: Vec<u8> = call.req(engine_state, stack, 0)?; let pattern: Vec<u8> = call.req(engine_state, stack, 0)?;
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let arg = Arguments { let arg = Arguments {
pattern, pattern,
cell_paths, cell_paths,

View File

@ -61,7 +61,7 @@ impl Command for BytesIndexOf {
) -> Result<PipelineData, ShellError> { ) -> Result<PipelineData, ShellError> {
let pattern: Vec<u8> = call.req(engine_state, stack, 0)?; let pattern: Vec<u8> = call.req(engine_state, stack, 0)?;
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let arg = Arguments { let arg = Arguments {
pattern, pattern,
end: call.has_flag("end"), end: call.has_flag("end"),

View File

@ -56,7 +56,7 @@ impl Command for BytesRemove {
input: PipelineData, input: PipelineData,
) -> Result<PipelineData, ShellError> { ) -> Result<PipelineData, ShellError> {
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let pattern_to_remove = call.req::<Spanned<Vec<u8>>>(engine_state, stack, 0)?; let pattern_to_remove = call.req::<Spanned<Vec<u8>>>(engine_state, stack, 0)?;
if pattern_to_remove.item.is_empty() { if pattern_to_remove.item.is_empty() {
return Err(ShellError::UnsupportedInput( return Err(ShellError::UnsupportedInput(

View File

@ -56,7 +56,7 @@ impl Command for BytesReplace {
input: PipelineData, input: PipelineData,
) -> Result<PipelineData, ShellError> { ) -> Result<PipelineData, ShellError> {
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 2)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 2)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let find = call.req::<Spanned<Vec<u8>>>(engine_state, stack, 0)?; let find = call.req::<Spanned<Vec<u8>>>(engine_state, stack, 0)?;
if find.item.is_empty() { if find.item.is_empty() {
return Err(ShellError::UnsupportedInput( return Err(ShellError::UnsupportedInput(

View File

@ -54,7 +54,7 @@ impl Command for BytesStartsWith {
) -> Result<PipelineData, ShellError> { ) -> Result<PipelineData, ShellError> {
let pattern: Vec<u8> = call.req(engine_state, stack, 0)?; let pattern: Vec<u8> = call.req(engine_state, stack, 0)?;
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let arg = Arguments { let arg = Arguments {
pattern, pattern,
cell_paths, cell_paths,

View File

@ -106,7 +106,7 @@ impl Command for SubCommand {
Ok(generate_strftime_list(call.head, true).into_pipeline_data()) Ok(generate_strftime_list(call.head, true).into_pipeline_data())
} else { } else {
let cell_paths = call.rest(engine_state, stack, 0)?; let cell_paths = call.rest(engine_state, stack, 0)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
// if zone-offset is specified, then zone will be neglected // if zone-offset is specified, then zone will be neglected
let timezone = call.get_flag::<Spanned<String>>(engine_state, stack, "timezone")?; let timezone = call.get_flag::<Spanned<String>>(engine_state, stack, "timezone")?;

View File

@ -54,7 +54,7 @@ impl Command for SubCommand {
input: PipelineData, input: PipelineData,
) -> Result<nu_protocol::PipelineData, nu_protocol::ShellError> { ) -> Result<nu_protocol::PipelineData, nu_protocol::ShellError> {
let cell_paths = call.rest(engine_state, stack, 0)?; let cell_paths = call.rest(engine_state, stack, 0)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let radix = call.get_flag::<Value>(engine_state, stack, "radix")?; let radix = call.get_flag::<Value>(engine_state, stack, "radix")?;
let radix: u32 = match radix { let radix: u32 = match radix {

View File

@ -172,7 +172,7 @@ fn string_helper(
} }
} }
let cell_paths = call.rest(engine_state, stack, 0)?; let cell_paths = call.rest(engine_state, stack, 0)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let config = engine_state.get_config().clone(); let config = engine_state.get_config().clone();
let args = Arguments { let args = Arguments {
decimals_value, decimals_value,

View File

@ -79,7 +79,7 @@ where
) -> Result<nu_protocol::PipelineData, nu_protocol::ShellError> { ) -> Result<nu_protocol::PipelineData, nu_protocol::ShellError> {
let binary = call.has_flag("binary"); let binary = call.has_flag("binary");
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 0)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 0)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let args = Arguments { binary, cell_paths }; let args = Arguments { binary, cell_paths };
operate( operate(
action::<D>, action::<D>,

View File

@ -24,7 +24,7 @@ impl CmdArgument for CellPathOnlyArgs {
impl From<Vec<CellPath>> for CellPathOnlyArgs { impl From<Vec<CellPath>> for CellPathOnlyArgs {
fn from(cell_paths: Vec<CellPath>) -> Self { fn from(cell_paths: Vec<CellPath>) -> Self {
Self { Self {
cell_paths: (!cell_paths.is_empty()).then(|| cell_paths), cell_paths: (!cell_paths.is_empty()).then_some(cell_paths),
} }
} }
} }

View File

@ -45,7 +45,7 @@ pub fn operate(
call.get_flag(engine_state, stack, "character-set")?; call.get_flag(engine_state, stack, "character-set")?;
let binary = call.has_flag("binary"); let binary = call.has_flag("binary");
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 0)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 0)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
// Default the character set to standard if the argument is not specified. // Default the character set to standard if the argument is not specified.
let character_set = match character_set { let character_set = match character_set {

View File

@ -61,7 +61,7 @@ impl Command for FileSize {
.as_string()? .as_string()?
.to_ascii_lowercase(); .to_ascii_lowercase();
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let arg = Arguments { let arg = Arguments {
format_value, format_value,
cell_paths, cell_paths,

View File

@ -49,7 +49,7 @@ where
F: Fn(&str) -> String + Send + Sync + 'static, F: Fn(&str) -> String + Send + Sync + 'static,
{ {
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 0)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 0)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let args = Arguments { let args = Arguments {
case_operation, case_operation,
cell_paths, cell_paths,

View File

@ -56,7 +56,7 @@ impl Command for SubCommand {
input: PipelineData, input: PipelineData,
) -> Result<PipelineData, ShellError> { ) -> Result<PipelineData, ShellError> {
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let args = Arguments { let args = Arguments {
substring: call.req::<String>(engine_state, stack, 0)?, substring: call.req::<String>(engine_state, stack, 0)?,
cell_paths, cell_paths,

View File

@ -58,7 +58,7 @@ impl Command for SubCommand {
) -> Result<PipelineData, ShellError> { ) -> Result<PipelineData, ShellError> {
let compare_string: String = call.req(engine_state, stack, 0)?; let compare_string: String = call.req(engine_state, stack, 0)?;
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let args = Arguments { let args = Arguments {
compare_string, compare_string,
cell_paths, cell_paths,

View File

@ -52,7 +52,7 @@ impl Command for SubCommand {
input: PipelineData, input: PipelineData,
) -> Result<PipelineData, ShellError> { ) -> Result<PipelineData, ShellError> {
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let args = Arguments { let args = Arguments {
substring: call.req::<String>(engine_state, stack, 0)?, substring: call.req::<String>(engine_state, stack, 0)?,
cell_paths, cell_paths,

View File

@ -66,7 +66,7 @@ impl Command for SubCommand {
) -> Result<PipelineData, ShellError> { ) -> Result<PipelineData, ShellError> {
let substring: Spanned<String> = call.req(engine_state, stack, 0)?; let substring: Spanned<String> = call.req(engine_state, stack, 0)?;
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let args = Arguments { let args = Arguments {
substring: substring.item, substring: substring.item,
range: call.get_flag(engine_state, stack, "range")?, range: call.get_flag(engine_state, stack, "range")?,

View File

@ -59,7 +59,7 @@ impl Command for SubCommand {
input: PipelineData, input: PipelineData,
) -> Result<PipelineData, ShellError> { ) -> Result<PipelineData, ShellError> {
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 0)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 0)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let args = Arguments { let args = Arguments {
length: call.get_flag(engine_state, stack, "length")?, length: call.get_flag(engine_state, stack, "length")?,
character: call.get_flag(engine_state, stack, "character")?, character: call.get_flag(engine_state, stack, "character")?,

View File

@ -71,7 +71,7 @@ impl Command for SubCommand {
let find: Spanned<String> = call.req(engine_state, stack, 0)?; let find: Spanned<String> = call.req(engine_state, stack, 0)?;
let replace: Spanned<String> = call.req(engine_state, stack, 1)?; let replace: Spanned<String> = call.req(engine_state, stack, 1)?;
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 2)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 2)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let literal_replace = call.has_flag("no-expand"); let literal_replace = call.has_flag("no-expand");
let no_regex = call.has_flag("string"); let no_regex = call.has_flag("string");

View File

@ -59,7 +59,7 @@ impl Command for SubCommand {
input: PipelineData, input: PipelineData,
) -> Result<PipelineData, ShellError> { ) -> Result<PipelineData, ShellError> {
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 0)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 0)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let args = Arguments { let args = Arguments {
length: call.get_flag(engine_state, stack, "length")?, length: call.get_flag(engine_state, stack, "length")?,
character: call.get_flag(engine_state, stack, "character")?, character: call.get_flag(engine_state, stack, "character")?,

View File

@ -55,7 +55,7 @@ impl Command for SubCommand {
) -> Result<PipelineData, ShellError> { ) -> Result<PipelineData, ShellError> {
let substring: Spanned<String> = call.req(engine_state, stack, 0)?; let substring: Spanned<String> = call.req(engine_state, stack, 0)?;
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let args = Arguments { let args = Arguments {
substring: substring.item, substring: substring.item,
cell_paths, cell_paths,

View File

@ -68,7 +68,7 @@ impl Command for SubCommand {
let range = call.req(engine_state, stack, 0)?; let range = call.req(engine_state, stack, 0)?;
let indexes: Substring = process_arguments(&range, call.head)?.into(); let indexes: Substring = process_arguments(&range, call.head)?.into();
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let args = Arguments { let args = Arguments {
indexes, indexes,
cell_paths, cell_paths,

View File

@ -100,7 +100,7 @@ impl Command for SubCommand {
None => None, None => None,
}; };
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 0)?; let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 0)?;
let cell_paths = (!cell_paths.is_empty()).then(|| cell_paths); let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let mode = match cell_paths { let mode = match cell_paths {
None => ActionMode::Global, None => ActionMode::Global,
Some(_) => ActionMode::Local, Some(_) => ActionMode::Local,

View File

@ -155,7 +155,7 @@ fn draw_table(
} }
let with_header = table.with_header; let with_header = table.with_header;
let with_footer = with_header && need_footer(config, (&table.data).size().0 as u64); let with_footer = with_header && need_footer(config, (table.data).size().0 as u64);
let with_index = table.with_index; let with_index = table.with_index;
if with_footer { if with_footer {

View File

@ -16,4 +16,4 @@ profile = "default"
# use in nushell, we may opt to use the bleeding edge stable version of rust. # use in nushell, we may opt to use the bleeding edge stable version of rust.
# I believe rust is on a 6 week release cycle and nushell is on a 3 week release cycle. # I believe rust is on a 6 week release cycle and nushell is on a 3 week release cycle.
# So, every two nushell releases, this version number should be bumped by one. # So, every two nushell releases, this version number should be bumped by one.
channel = "1.63.0" channel = "1.64.0"