compatible with old rust (#5974)

This commit is contained in:
WindSoilder
2022-07-07 07:22:45 +08:00
committed by GitHub
parent 8abf28093a
commit e0b4ab09eb
6 changed files with 30 additions and 6 deletions

View File

@ -56,7 +56,11 @@ impl Command for BytesReplace {
input: PipelineData,
) -> Result<PipelineData, ShellError> {
let column_paths: Vec<CellPath> = call.rest(engine_state, stack, 2)?;
let column_paths = (!column_paths.is_empty()).then_some(column_paths);
let column_paths = if column_paths.is_empty() {
None
} else {
Some(column_paths)
};
let find = call.req::<Vec<u8>>(engine_state, stack, 0)?;
if find.is_empty() {
return Err(ShellError::UnsupportedInput(