mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 05:53:39 +00:00
internal/wasm-tools, syscall: update to wasm-tools-go@v0.3.1 (#4577)
* internal/wasm-tools, internal/cm: update wasm-tools-go to v0.3.1 and regenerate bindings * syscall: use new (cm.Result).Result() method instead of OK() and Err()
This commit is contained in:
@@ -71,6 +71,16 @@ func (r *result[Shape, OK, Err]) Err() *Err {
|
||||
return (*Err)(unsafe.Pointer(&r.data))
|
||||
}
|
||||
|
||||
// Result returns (OK, zero value of Err, false) if r represents the OK case,
|
||||
// or (zero value of OK, Err, true) if r represents the error case.
|
||||
// This does not have a pointer receiver, so it can be chained.
|
||||
func (r result[Shape, OK, Err]) Result() (ok OK, err Err, isErr bool) {
|
||||
if r.isErr {
|
||||
return ok, *(*Err)(unsafe.Pointer(&r.data)), true
|
||||
}
|
||||
return *(*OK)(unsafe.Pointer(&r.data)), err, false
|
||||
}
|
||||
|
||||
// This function is sized so it can be inlined and optimized away.
|
||||
func (r *result[Shape, OK, Err]) validate() {
|
||||
var shape Shape
|
||||
|
||||
Reference in New Issue
Block a user