Comment by redman25

6 months ago

The point is the language forces you to explicitly handle the null. You have to make the choice. Using `expect`, the programmer would understand that that is equivalent to a panic. Why would they intentionally panic?

"Yes it's an Option but it will never be None, the RPC layer validates the request and will reject the call if this field isn't set. Plumbing error handling into this callback is gonna require significant refactoring here, it's not worth it for a theoretical case so let's just .expect()".

People say this kinda thing every day. It's just as easy to say in Rust terminology as any other ecosystem.

Rust has a lot of crucial benefits but "you can't crash the process by making lazy assumptions" isn't one of them.