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

Function RoundtripOption

tests/runtime/variants/test.go:9–18  ·  view source on GitHub ↗
(x Option[float32])

Source from the content-addressed store, hash-verified

7)
8
9func RoundtripOption(x Option[float32]) Option[uint8] {
10 switch x.Tag() {
11 case OptionSome:
12 return Some[uint8](uint8(x.Some()))
13 case OptionNone:
14 return None[uint8]()
15 default:
16 panic("unreachable")
17 }
18}
19
20func RoundtripResult(x Result[uint32, float32]) Result[float64, uint8] {
21 switch x.Tag() {

Callers 1

RunMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected