Convert more ShellError variants to named fields (#11222)

# Description

Convert errors to named fields:
* NeedsPositiveValue
* MissingConfigValue
* UnsupportedConfigValue
* DowncastNotPossible
* NonUtf8Custom
* NonUtf8
* DidYouMeanCustom
* DidYouMean
* ReadingFile
* RemoveNotPossible
* ChangedModifiedTimeNotPossible
* ChangedAccessTimeNotPossible

Part of #10700
This commit is contained in:
Eric Hodel
2023-12-04 01:19:32 -08:00
committed by GitHub
parent b227eea668
commit 67eec92e76
26 changed files with 299 additions and 208 deletions

View File

@ -78,7 +78,7 @@ impl From<ShellError> for LabeledError {
msg: format!("can't convert from {input} to {expected}"),
span: Some(span),
},
ShellError::DidYouMean(suggestion, span) => LabeledError {
ShellError::DidYouMean { suggestion, span } => LabeledError {
label: "Name not found".into(),
msg: format!("did you mean '{suggestion}'?"),
span: Some(span),