mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Remove --encoding
argument during register plugin (#6486)
* first implement new plugin protocol core logic * fix debug body construct * fix output message from plugin * finish plugin commands calling * fix tests and adjust plugin_custom_value call * fmt code * fmt code, fix clippy * add FIXME comment * change from FIXME to TODO
This commit is contained in:
@ -6,7 +6,7 @@ pub struct MsgPackSerializer;
|
||||
|
||||
impl PluginEncoder for MsgPackSerializer {
|
||||
fn name(&self) -> &str {
|
||||
"MsgPack Serializer"
|
||||
"msgpack"
|
||||
}
|
||||
|
||||
fn encode_call(
|
||||
@ -23,7 +23,7 @@ impl PluginEncoder for MsgPackSerializer {
|
||||
reader: &mut impl std::io::BufRead,
|
||||
) -> Result<crate::protocol::PluginCall, nu_protocol::ShellError> {
|
||||
rmp_serde::from_read(reader)
|
||||
.map_err(|err| ShellError::PluginFailedToEncode(err.to_string()))
|
||||
.map_err(|err| ShellError::PluginFailedToDecode(err.to_string()))
|
||||
}
|
||||
|
||||
fn encode_response(
|
||||
@ -40,7 +40,7 @@ impl PluginEncoder for MsgPackSerializer {
|
||||
reader: &mut impl std::io::BufRead,
|
||||
) -> Result<PluginResponse, ShellError> {
|
||||
rmp_serde::from_read(reader)
|
||||
.map_err(|err| ShellError::PluginFailedToEncode(err.to_string()))
|
||||
.map_err(|err| ShellError::PluginFailedToDecode(err.to_string()))
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user