Closed jaysonsantos closed 2 years ago
I wonder if it would be better to use sync::Once on color_eyre::install to make sure only one instance is being installed using a singleton, what do you think? let me know and i can change the pr
I think I prefer this version as is over doing it in a Once
. It's easy enough^1 to write a wrapping function using a Once
if you're going to intentionally race a bunch of installs, and in my experience color-eyre isn't the only library where you need to worry about initializing it once in tests so leaving that to the user seems like the right balance to me.
@yaahc cool! Then, I just sent the fix for the example as I only ran a simple cargo test
here
I updated an error message and I think it's gonna break fmt :X
edit: it didn't! Easyyyyy
this also seems to fix #78
When writing tests it is really useful to use color-eyre to have better messages but, calling install multiple times will panic. This should return an error instead. It should fix #97