try_lock
already exists; it’s called lock
. I just want a more convenient name and I want the name of the new method to be lock
, but that ship has sailed.
try_lock
already exists; it’s called lock
. I just want a more convenient name and I want the name of the new method to be lock
, but that ship has sailed.
Looks like the author missed my main complaint about Rust mutexes, which is that the lock
method returns a Result
. There should be a try_unlock
method for when someone actually wants to handle the rather obscure failure case, and the name lock
should be used for a method that panics on failure but returns a value that doesn’t need to be unwrapped first. I see the current arrangement as being about as sensible as having array subscripting return a Result
to handle the case of a failed bounds check.
I think you’re underestimating how resistant to charge old people can be.
I know people in tech who use iPhones. But they’re definitely the exception.
Nah, I did everything wrong in my 20s and I experienced nothing like OP’s symptoms.
You asked for a yes or no answer on Google being a monopoly, and it said yes. What more do you want? Your issue is that Google confessed but not thoroughly enough?
So Gemini came up with the same decision as the US court? Is there supposed to be something surprising here?
🙄
If paying for a service you use is the worst thing you can imagine, you really need to read the news at least once a decade.
Can confirm; roommate has a chihuahua.
The way you say no is by not visiting the site.
Bishop Briggs
I played “Like a River” to try out the sound system in a car I got recently. Does that count?
It would, however, seem like a straight line to whoever was on the boat, because they’d be traveling due west the whole time, and the course corrections they’d have to make to keep going west would look the same as course corrections needed to account for wind, ocean currents, etc.
I thought that for a long time. Then I finally gave in and got some. They’re fantastic.
Way, way more content. Lemmy isn’t even close.
I think a better solution would be to add a method called something like ulock that does a combined lock and unwrap.
My concern with lock+unwrap is only partly because of convenience; I also didn’t like it because I think it’s a bad idea to get people used to casually calling unwrap, because it tends to hide inadequate error handing.
Now that I think about it, I don’t like how unwrap can signal either “I know this can’t fail”, “the possible error states are too rare to care about” or “I can’t be bothered with real error handing right now”. In one or two of those cases you want to leave it in my production code, and in the last you want to audit all instances and replace them with proper error handing. Using the same function for all three cases makes that difficult.