@sir what's match? Is it error handling?

@af @sir It's like a switch statement in C but instead of the cases being values they are types. It's called pattern matching if you want to learn more about it, there are a lot of really cool things that pattern matching can do.

In this case it looks like it is being used as a way to handle errors by matching against an error type, or succeeding by matching against some value otherwise.

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml