Closed frewsxcv closed 9 years ago
Oh hold on, i'll fix that
Now that's good. Thanks for your work !
Last I checked it wasn't actually equivalent, because the second part of result is a String instead of an Error. Look at the output in the failure mode.
@gkoz I don't understand, can you elaborate your concerns?
Make pkg-config fail and see what cargo build prints out.
Make pkg-config fail
What do you mean by this?
The match you replaced had two arms. Have you tested both scenarios after making the change and confirmed that in either of them the new code behaves in exactly the same way [as before]?
It should functionally be the same, but it looks like it also adds extra text when it panics
Feel free to revert my commit if you don't want that text to be shown
Note the {:?}
there? The match used {}
and it makes a difference in this case, because debug formatting of String
isn't very readable. It becomes fairly obvious when you test the failure mode of the build script.
Sorry @frewsxcv but I have to revert your PR. Thanks @gkoz.
All good, sorry for the confusion. Keep up the great work with this project
@frewsxcv No problem. Don't hesitate to add anymore stuff, this project is far to be finished and any help is very appreciated !
I've discussed this issue on IRC and the sentiment is that unwrap
should only be used when it's not expected to panic therefore the end users aren't supposed to see the output it produces. If we, like in this case, want to panic with a message, better do it explicitly.
Thanks for that ! I wait travis to confirm and I merge.