Skip to content

Commit 8214193

Browse files
committed
Don't use internal prelude API
1 parent 1fbc8a2 commit 8214193

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rad_ffi.mjs

+3-3
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ const ok_signals = [...Array(3)].map((_, i) => i + 385);
140140
export function watch_loop(watch_fun, do_fun) {
141141
while (true) {
142142
let result = watch_fun();
143-
if (result.isOk()) {
143+
if (result instanceof Ok) {
144144
do_fun();
145145
} else if (ok_signals.includes(result[0][0])) {
146146
// Exit successfully on some signals.
@@ -170,15 +170,15 @@ export function decode_object(data) {
170170

171171
export function toml_decode_every(toml, key_path, decoder) {
172172
let result = toml_get(toml, key_path);
173-
if (!result.isOk()) {
173+
if (result instanceof GleamError) {
174174
let decode_error = new DecodeError("field", "nothing", key_path);
175175
return new GleamError(toList([decode_error]));
176176
}
177177
toml = result[0];
178178
let items = Object.keys(toml)
179179
.map((key) => {
180180
let result = decoder(toml[key]);
181-
return [key, result.isOk() ? result[0] : Nil];
181+
return [key, result instanceof Ok ? result[0] : Nil];
182182
})
183183
.filter(([_key, value]) => Nil !== value);
184184
return new Ok(toList(items));

0 commit comments

Comments
 (0)