Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hexaredecimal/result.odin
Result<T, E> in odin :)
https://github.com/hexaredecimal/result.odin
Last synced: 9 days ago
JSON representation
Result<T, E> in odin :)
- Host: GitHub
- URL: https://github.com/hexaredecimal/result.odin
- Owner: hexaredecimal
- Created: 2024-11-08T19:12:58.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-08T19:23:53.000Z (3 months ago)
- Last Synced: 2024-11-08T20:25:06.469Z (3 months ago)
- Language: Odin
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Result for odin lang
### Why
>> To avoid the nil check by any means necessary>> For fun
## Example
```odin
import rs "result"safe_div :: proc(x: i32, y: i32) -> rs.Result(i32, string) {
if y == 0 do return rs.Err(string){"Divide by zero"}
return rs.Ok(i32){x / y}
}
```