Gotcha. I unfortunately decided to give up on trying to do this in Rust. I'm trying out JUCE since it's industry standard. I'm already bashing my head against the wall with this C++ garbage. Hopefully the gui scene looks better for rust soon
Barbacamanitu
For real. Unless he's converting between results and ints millions of times a second, I think he's going to be just fine using the idiomatic solution. That transmute shit I'd wack lol
So what! Who cares if it's free? Write first, profile and optimize later. Not everyone cares about whether the conversion is free. Simply matching and converting to the right integer is fast enough.
I decided to give up. Iced just isn't a mature enough gui framework and the alternatives don't look great either.
I restarted my plug in project using JUCE tonight and I already have the gui started. It's c++, so that sucks, but oh well
Unfortunately, you are correct. We're doomed.
I once saw a comment where a guy said that before the internet, if someone wanted to fuck toasters and told anyone, he would be shamed and made fun of to the point where he'd never bring it up again.
With the internet, if someone wants to fuck a toaster, they can go online and find a while community of people who also enjoy fucking toasters, complete with guides and recommendations on the best toasters to fuck.
Its absurd, but it illustrates a great point. So yeah, we are fucked. Pandoras box is open.
Agreed. I also believe we should all stop showing up for work until we are guaranteed health care, a living wage, and reasonable housing prices. We shouldn't contribute to system that works against us.
I don't have a minimal example yet because I haven't been able to get it working. The framework I'm using (nih-plug) uses a specific version of iced though, so I'm going to try to just model mine off their example. I don't think it uses the pure version.
Everyone I know has to work multiple jobs and have roommates to be able to afford housing. What is this free time you speak of?
No. The divide between the rich and everyone else is growing. We will be able to afford less and less.
We shame them for being shitty. Don't engage them in debate, they are used to that. Don't try to use facts, because they don't care about facts. Don't try to convince them of shit.
Make them feel like outcasts and bad people. Brush off what they say when they say horrible shit. Make them have emotional responses to their shitty views. Conservative news targets these people by exploiting their emotions.
And vote. Vote for people who will fix our education system so that our next generation knows how to think for themselves.
That money goes to administrators instead of teachers.
Well if you want to keep an int as an int, then use an int. If you want to use Results, use results. Like I said to the other commenter: unless this code is in a very tight loop where performance is crucial, you'll be fine just implementing From/Into to change your Result to and from an int. You're already crossing a language boundary by calling c code from Rust. Is it that much more of an issue to just convert the types when you need to?
Trying to store the results as an int in some magical way just screams premature optimization. You have abstraction tools at your disposal. They may not be zero cost, but they are cheap. Use them.