|
|
|
|
|
by tiehuis
3205 days ago
|
|
Yes you have it right, `unwrap()` is equivalent to `%%`. It will panic if the result is an error. Error values under the hood are just unsigned integers and are returned on the stack. In fact, the granularity at which allocators are exposed in the stdlib makes any possible dynamic allocation very explicit in the language. This link [1] provides an overview of errors and some of the surrounding control flow. [1]: http://ziglang.org/documentation/#errors |
|
If you had an error you wished to pass a reason string for, would you need to use a global static or something?