mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Convert PluginFailedToDecode to named fields (#11126)
# Description Part of #10700 # User-Facing Changes None # Tests + Formatting - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib` # After Submitting N/A
This commit is contained in:
@ -27,8 +27,9 @@ impl PluginEncoder for MsgPackSerializer {
|
||||
&self,
|
||||
reader: &mut impl std::io::BufRead,
|
||||
) -> Result<crate::protocol::PluginCall, nu_protocol::ShellError> {
|
||||
rmp_serde::from_read(reader)
|
||||
.map_err(|err| ShellError::PluginFailedToDecode(err.to_string()))
|
||||
rmp_serde::from_read(reader).map_err(|err| ShellError::PluginFailedToDecode {
|
||||
msg: err.to_string(),
|
||||
})
|
||||
}
|
||||
|
||||
fn encode_response(
|
||||
@ -47,8 +48,9 @@ impl PluginEncoder for MsgPackSerializer {
|
||||
&self,
|
||||
reader: &mut impl std::io::BufRead,
|
||||
) -> Result<PluginResponse, ShellError> {
|
||||
rmp_serde::from_read(reader)
|
||||
.map_err(|err| ShellError::PluginFailedToDecode(err.to_string()))
|
||||
rmp_serde::from_read(reader).map_err(|err| ShellError::PluginFailedToDecode {
|
||||
msg: err.to_string(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user