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

Function VariantError

tests/runtime/results/leaf.go:35–45  ·  view source on GitHub ↗
(x float32)

Source from the content-addressed store, hash-verified

33}
34
35func VariantError(x float32) Result[float32, E3] {
36 if x == 0.0 {
37 return Err[float32, E3](MakeE3E2(E2{420, 0}))
38 } else if x == 1.0 {
39 return Err[float32, E3](MakeE3E1(EB))
40 } else if x == 2.0 {
41 return Err[float32, E3](MakeE3E1(EC))
42 } else {
43 return Ok[float32, E3](x)
44 }
45}
46
47func EmptyError(x uint32) Result[uint32, Unit] {
48 if x == 0 {

Callers 2

VariantErrorMethod · 0.70
RunMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected