Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
entry_path_buf
instead oferr.0.display
right ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, ish. The
entry_path_buf
was moved into thesend
, so we'd have to clone it. But conveniently, ifsend
returns an Error, it puts theT
back inside. So in our case here,err.0
isentry_path_buf
and we don't need to clone it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice, was not aware. And it looks like the
Display
impl forSendError
does NOT print theT
so we will not be double printing out theT
.https://docs.rs/crossbeam-channel/0.5.11/src/crossbeam_channel/err.rs.html#124-128
nit: Thoughts on using
into_inner()
over.0
? I doubt crossbeam would be adding additional items (and reordering them) at this point, but I feel likeinto_inner()
is slighter more expressivehttps://docs.rs/crossbeam/latest/crossbeam/channel/struct.SendError.html#method.into_inner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we used
into_inner()
, would we lose the ability to log the error itself though?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm yeah, I guess since we're inside a
let Err(err) = ...
block, we can't callinto_innter()
as that would move it. So, we'd have to clone; granted this isn't a big deal since the clone would be in the same line that we're panicking, but I think we can leave the.0
too