Skip to content

hexaredecimal/Result.odin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Result<T, E> for odin lang

Why

To avoid the nil check by any means necessary

For fun

Example

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}
}

About

Result<T, E> in odin :)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages