mirror of
https://github.com/nushell/nushell.git
synced 2025-04-15 16:58:19 +02:00
update encode decode with new signature (#5881)
This commit is contained in:
parent
173d60d59d
commit
a142d1a192
@ -2,7 +2,7 @@ use super::base64::{operate, ActionType, CHARACTER_SET_DESC};
|
|||||||
use nu_protocol::ast::Call;
|
use nu_protocol::ast::Call;
|
||||||
use nu_protocol::engine::{Command, EngineState, Stack};
|
use nu_protocol::engine::{Command, EngineState, Stack};
|
||||||
use nu_protocol::{
|
use nu_protocol::{
|
||||||
Category, Example, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, Value,
|
Category, Example, PipelineData, ShellError, Signature, Span, SyntaxShape, Value,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
@ -69,14 +69,6 @@ impl Command for DecodeBase64 {
|
|||||||
) -> Result<PipelineData, ShellError> {
|
) -> Result<PipelineData, ShellError> {
|
||||||
operate(ActionType::Decode, engine_state, stack, call, input)
|
operate(ActionType::Decode, engine_state, stack, call, input)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn input_type(&self) -> Type {
|
|
||||||
Type::Any
|
|
||||||
}
|
|
||||||
|
|
||||||
fn output_type(&self) -> Type {
|
|
||||||
Type::Any
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
@ -26,6 +26,7 @@ impl Command for EncodeBase64 {
|
|||||||
SyntaxShape::CellPath,
|
SyntaxShape::CellPath,
|
||||||
"optionally base64 encode data by column paths",
|
"optionally base64 encode data by column paths",
|
||||||
)
|
)
|
||||||
|
.output_type(Type::String)
|
||||||
.category(Category::Hash)
|
.category(Category::Hash)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,14 +58,6 @@ impl Command for EncodeBase64 {
|
|||||||
) -> Result<PipelineData, ShellError> {
|
) -> Result<PipelineData, ShellError> {
|
||||||
operate(ActionType::Encode, engine_state, stack, call, input)
|
operate(ActionType::Encode, engine_state, stack, call, input)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn input_type(&self) -> Type {
|
|
||||||
Type::Any
|
|
||||||
}
|
|
||||||
|
|
||||||
fn output_type(&self) -> Type {
|
|
||||||
Type::String
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
Loading…
Reference in New Issue
Block a user