I swear I'm missing something about this language, and it's super frustrating. Any advice?
OK, this is not meant to be a rant, more of a cry for help? I don't know. There is something about Rust that just makes it impossible for me to progress. Every time I think I understand something, then try to implement it in a slightly different way, I get nailed on the head with another error that 100% is not explained by "rustc --explain". Here is an example:
I am trying to use CHashMap, a crate that should, ostensibly, allow for concurrent access to a hashmap. My Hashmap uses strings for keys and i32s for values. However, when updating the map I have to first read the i32 stored at the appropriate key, add 1 to it, then write it back to the hashmap. This won't work, because the original read locks that value. No problem, think I, I will just use "get\_mut", which is supposed to let me do this. But no. Now it's a problem with the WriteGuard. And on and on it goes.
I find myself spending HOURS trying to figure out workarounds. It cannot possibly be this hard. I just want to update data ffs. What am I missing? I'd like to pretend I understand borrowing, but every time I come across an error like this the help docs introduce a new weird thing I've never heard of (wtf is a "shard" and how is it different from a "slice"?)
I am so shockingly frustrated with Rust. I just can't figure it out. Ah.