mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 23:37:48 +02:00
Add ErrSpan
extension trait for Result
(#12626)
# Description This adds an extension trait to `Result` that wraps errors in `Spanned`, saving the effort of calling `.map_err(|err| err.into_spanned(span))` every time. This will hopefully make it even more likely that someone will want to use a spanned `io::Error` and make it easier to remove the impl for `From<io::Error> for ShellError` because that doesn't have span information.
This commit is contained in:
@ -117,7 +117,7 @@ impl Command for Do {
|
||||
None,
|
||||
)
|
||||
})
|
||||
.map_err(|e| e.into_spanned(call.head))
|
||||
.err_span(call.head)
|
||||
})
|
||||
.transpose()?;
|
||||
|
||||
|
Reference in New Issue
Block a user