• 11 Posts
  • 2.17K Comments
Joined 2 years ago
cake
Cake day: July 19th, 2024

help-circle






  • This is likely. They are sponsoring all kinds of extremism and separatism. Their biggest success to date was Brexit, but the rise of the neonazis in Germany, France, Italy, Poland, Hungary, Romania, Slovenia, USA is not to be underestimated as well.

    They understand very well that they don’t have the faintest chance or even leverage against a united Europe/CA/NZ/AUS/USA. None at all. But divide us, and attack us one by one? Now that they can do. A single European country will have difficulties defending itself, be it economically or militarily.

    This is why we must remain united against these dictators. We obviously have many differences and quarrel amongst ourselvee, that is completely fine, as long as we stand together when it comes to saying “fuck off and then fuck off some more and then fuck of all the way and stay fucked off” to the dictators.








  • For multiple types turning into one variant: you can either impl From for the others yourself, or you can have another enum with variants for them and have thiserror generate the From impl. I usually have lots of enums, at least one per module, sometimes even one per function, that form a tree. The errors you design should relate to the action that was being tried, and only encapsulate the lower error as context information.

    I see you’re using strings. You can do that, but then you’ll lose control over formatting, and additional context info that might be contained in them.

    Designing errors isn’t trivial and requires some experience. Try some things and over time you’ll see what works best.

    You can also check out https://docs.rs/snafu/latest/snafu/guide/index.html, another great library - their docs contain excellent guidance on designing error types.