MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / EmptyError

Function EmptyError

tests/runtime/results/leaf.go:47–55  ·  view source on GitHub ↗
(x uint32)

Source from the content-addressed store, hash-verified

45}
46
47func EmptyError(x uint32) Result[uint32, Unit] {
48 if x == 0 {
49 return Err[uint32, Unit](Unit{})
50 } else if x == 1 {
51 return Ok[uint32, Unit](42)
52 } else {
53 return Ok[uint32, Unit](x)
54 }
55}
56
57func DoubleError(x uint32) Result[Result[Unit, string], string] {
58 if x == 0 {

Callers 2

EmptyErrorMethod · 0.70
RunMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected