You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some programs parse inside a function that returns an anyhow-style error type or a custom error type. This doesn't play well with OsString::into_string(): its error type (OsString) can convert to anyhow::Error but not to most other error types.
Another workaround would be .into_string().map_err(lexopt::Error::from)?.
Yet another is .parse()?. This performs a copy.
A ValueExt::string(self) -> Result<String, lexopt::Error> method would solve this. (There may be a better name.)
Error's From<OsString> impl should then be kept, except perhaps in a release that already breaks most code for other reasons. But it should be removed from the README.
The text was updated successfully, but these errors were encountered:
Some programs parse inside a function that returns an
anyhow
-style error type or a custom error type. This doesn't play well withOsString::into_string()
: its error type (OsString
) can convert toanyhow::Error
but not to most other error types.rres
uses.into_string().unwrap()
.minoru-fediverse-crawler
uses.into_string().map_err(|ostr| anyhow!("{}", ostr.to_string_lossy()))?
..into_string().map_err(lexopt::Error::from)?
..parse()?
. This performs a copy.A
ValueExt::string(self) -> Result<String, lexopt::Error>
method would solve this. (There may be a better name.)Error
'sFrom<OsString>
impl should then be kept, except perhaps in a release that already breaks most code for other reasons. But it should be removed from the README.The text was updated successfully, but these errors were encountered: