Convert PluginFailedToLoad to named fields (#11124)

# 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:
Eric Hodel
2023-11-21 15:30:52 -08:00
committed by GitHub
parent e36f69bf3c
commit a42fd3611a
6 changed files with 51 additions and 32 deletions

View File

@@ -83,7 +83,7 @@ impl From<ShellError> for LabeledError {
msg: format!("did you mean '{suggestion}'?"),
span: Some(span),
},
ShellError::PluginFailedToLoad(msg) => LabeledError {
ShellError::PluginFailedToLoad { msg } => LabeledError {
label: "Plugin failed to load".into(),
msg,
span: None,

View File

@@ -68,9 +68,9 @@ impl CustomValue for PluginCustomValue {
let stdout_reader = match &mut child.stdout {
Some(out) => out,
None => {
return Err(ShellError::PluginFailedToLoad(
"Plugin missing stdout reader".into(),
))
return Err(ShellError::PluginFailedToLoad {
msg: "Plugin missing stdout reader".into(),
})
}
};
get_plugin_encoding(stdout_reader)?