Details
-
AboutAAAAAAAAAAAAAAAAAAA
-
SkillsRust and other things
-
Locationhere
-
Website
Joined devRant on 12/8/2018
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
I think spammers like you should all kill themselves
-
@jestdotty Never heard of screeps, i will check it out
-
Call me old fashioned but vibe coding still kinda sucks
Which isn't surprising considering they use GPT models and ChatGPT 5 still sucks at coding -
@jestdotty Bevy is great. Can also become pretty complex though!
-
Pharmaceutical spam on devRant lul
-
@jestdotty Hard to put into words
But essentially try to make your logic into a tree starting in your main function instead of having a decentralized graph of objects which act independently
More like the C-ish mindset instead of Java-ish mindset
Of course that's easy to say but hard for me to give you specific tips -
@cprn You have literally zero clue what you are talking about
Rust solves a GIGANTIC problem which is low level systems programming without memory unsafety and UB
That's an insane goal to have and Rust miraculously did it -
You can't port something 1:1 from JS to Rust, that won't work well
I think the major problem is that you are way too deep in the object oriented mindset. Trying to code like that in Rust leads to pain and tears
(as for reqwest hanging, im still pretty sure it's your liberal use of Arc<Mutex<>> which deadlocks your program, so don't use that!) -
DevRant in general is kinda fucky right now. Loading this rant timed out the first time, then took like 20 seconds
-
@jestdotty No just a pun on "lifetime" :P
You'll get there! In Rust you just sometimes have to think outside the box to find a good architecture
I still struggle with this too sometimes -
That'll take you a lifetime
-
Forgot to switch accounts *facepalm*
-
Hmmm honestly I think it would be better to not have a store app at all in favor of a website with a custom protocol handler (like ubuntu-install://install//... or something) for installing packages onto your system
-
Both evaluate truthyness, but the first one explicitely "casts" it into a bool
E.g.
let notEmpty = someString; // notEmpty is a string
let notEmpty = !!someString; // notEmpty is a bool
If used in an if condition or with other boolean operators it doesn't matter since they automatically coerce it into a bool -
@antigermgerm That's what it's for. It's essentially a way better C (and thus also without some of the higher level C++/Rust niceties like RAII)
Quite an interesting lang -
@jestdotty Hit me up tomorrow im waaay too drunk right now :D
Not sure if actors make sense though. But you NEED to do something about those Arc<Mutex<T>>. Those are killing your code, at least to some degree -
@jestdotty I get what you mean with the and_then() + .ok().... Yeah it can be annoying. You could rewrite it into a single and_then with the two conversions followed by the ? operator, but that doesn't improve it much (https://play.rust-lang.org//... )
For your new problem, yeah those signatures are cuuuursed :P
Async rust can be hard
Though I believe a lot of those 'static and Send bounds are required because tokio requires those. I've heard other executors are more lenient (but also only can run the future on the spawning thread)
As for Arc<Mutex<T>>: I think this is pretty much always a code smell. As you probably notice in your code, it results in a LOT of .lock().unwrap() which is giga ugly and also just leads to deadlocks
I think its best for async rust apps to do more of an actor pattern kinda like go, where many independent single-thread actors communicate over channels
My 2 cents :P -
@cafecortado Spoilers :(
I wanted to hear his scam pitch -
@jestdotty Can you post the snippet that annoys you?
-
@jestdotty I meeaaaaan depends on what you're doing
Rust is plenty logical but some things can be a hassle sometimes
Can't really say much more without knowing anything about your code -
(btw the try operator can do type conversions if you have the right From impls, then you don't need to manually map_err)
-
Being forced to handle both the happy and the error path is whats makes rust great though
-
You say you are depressed and then you post rage bait to beef with people leading to even more negative emotions
What the fuck is actually wrong with you. Anger and hate seems to be the only thing driving you -
Something something trans joke
-
In that case, she's not really wrong ¯\_(ツ)_/¯
-
@Wisecrack Considering its a wednesday and im getting drunk as fuck I think you can piece together whether im an alcoholic or not ;P
(Aware) -
@Wisecrack Its not looking good im just gonna be honest
-
Im too drunk to understand what you're saying :D
-
@antigermgerm Not even a loli joke as a comeback, boring 😴
-
@Lensflare Noticed that as well lol