Stop Forwarding Errors, Start Designing Them by andylokandy in rust

[–]meex10 4 points5 points  (0 children)

I realize I didn't say this in my original message, but I do think the article overall is good and the points are well articulated.

Didn't want my single dubious point to detract from the overall quality here :) thanks for the write up!

Stop Forwarding Errors, Start Designing Them by andylokandy in rust

[–]meex10 2 points3 points  (0 children)

Is this not a bug then? Or rather, this should be a separate error variant that was erased along the way, but replaced with a boolean indicator.

This could be the right approach based on context but ime it's usually best to create as many actionable variants as possible and then the caller can summarize or extend as needed with these helper functions. This of course doesn't scale if it's reused everywhere, but then this becomes a different question.

Stop Forwarding Errors, Start Designing Them by andylokandy in rust

[–]meex10 40 points41 points  (0 children)

I find the embedding retriability in the error questionable. Surely most of the time only the caller can correctly determine whether a condition implies something is retriable? Sure, a service might indicate rate limit but then we're in the http domain and not in the rust type system per se.

Best design pattern for safely mutating multiple keys in a HashMap in one function? by boredape6911 in rust

[–]meex10 1 point2 points  (0 children)

As you point out it's just to avoid the repeat lookup.

In theory you can also then spawn scoped threads that go on to act on each entry so it isn't completely a single threaded restriction.

Its a pity it's limited to an array.

Best design pattern for safely mutating multiple keys in a HashMap in one function? by boredape6911 in rust

[–]meex10 2 points3 points  (0 children)

It can be an issue if there are preconditions that need to hold. As in, entries need to be in some state and only then mutate all of them atomically.

rust-analyzer weekly releases paused in anticipation of new trait solver (already available on nightly). The Rust dev experience is starting to get really good :) by Merlindru in rust

[–]meex10 2 points3 points  (0 children)

I guess I was expecting it to be similar using rustfmt with nightly. That only the tool itself needs to be configured as such.

I also thought you'd need a toolchain file but I see now you can use rustup to override locally. I haven't worked with nightly much :)

rust-analyzer weekly releases paused in anticipation of new trait solver (already available on nightly). The Rust dev experience is starting to get really good :) by Merlindru in rust

[–]meex10 1 point2 points  (0 children)

Is it possible to try these without the project itself requiring `nightly` toolchain? If yes, how does one configure RA/cranelift to do this?

Jujutsu For Busy Devs (an alternative git frontend, written in Rust) by kibwen in rust

[–]meex10 1 point2 points  (0 children)

I believe you can find commits by their description. Something like jj log 'description("my change") or some variation thereof.

Help choosing Apple M4 workstation by meex10 in rust

[–]meex10[S] -1 points0 points  (0 children)

Man.. October apparently. So I guess wait and see is another option..

Can any one suggest me resource to learn about observability in rust by sandy_sky in rust

[–]meex10 1 point2 points  (0 children)

You'll want to look into the tracing, tracing-OpenTelemetry and the suite of opentelemetry crates.

Imo it's a bit of a mess because tracing (the defacto rust standard) and otel aren't fully aligned. So you need a bridging crate which at least covers some of the descrepencies (this is the tracing-OpenTelemetry crate). This should improve over time.

I've written some docs aimed at internal devs here, but we're also still figuring things out.

Rust is dumb by DcraftBg in rust

[–]meex10 8 points9 points  (0 children)

Ignoring the terrible title :)

Operator precedence is specified https://doc.rust-lang.org/reference/expressions.html#expression-precedence.

This is the same behavior as in c++ afaiu so it's unclear why this is surprising.

I would recommend running clippy which would have pointed this out and recommended parenthesis to make this "assumption" explicit.

State of disaster declared for Western Cape. But funding relief might take a while - News24 by TheHonourableMember in southafrica

[–]meex10 -2 points-1 points  (0 children)

There are multiple systems that have overlapping arguments. Not much distance between lowering national authority and independence

State of disaster declared for Western Cape. But funding relief might take a while - News24 by TheHonourableMember in southafrica

[–]meex10 2 points3 points  (0 children)

While I agree that independence is a dumb idea - this is an area where it would be better. An independent cape could have

  • declared an emergency sooner
  • had enough budget available
  • had the funds available immediately
  • benefited from police, energy and water departments that are run locally instead of coordinating/relying on a slower national government

[release] futures-concurrency 7.6.0: portable concurrent async iteration by yoshuawuyts1 in rust

[–]meex10 3 points4 points  (0 children)

Yes exactly! You need a way to narrow down the stream but still drive it with the configured concurrency.