Remove cast from void! to anyfault. Rename @catchof to @catch

This commit is contained in:
Christoffer Lerno
2023-09-09 22:49:32 +02:00
parent dfe097931c
commit d67e846712
21 changed files with 250 additions and 185 deletions

View File

@@ -133,7 +133,7 @@ fn void main()
bool! has_title = readWhetherTitleNonEmpty(url);
// This looks a bit less than elegant, but as you see it's mostly due to having to
// use printf here.
io::printf(" Has title: %s vs %s\n", bool_to_string(has_title) ?? (@catchof(has_title)).nameof, has_title ?? false);
io::printf(" Has title: %s vs %s\n", bool_to_string(has_title) ?? (@catch(has_title)).nameof, has_title ?? false);
};
dynamic_arena.reset();
}

View File

@@ -44,7 +44,7 @@ fn int! askGuessMulti(int high)
while (true)
{
int! result = askGuess(high);
if (@catchof(result) == InputResult.NOT_AN_INT)
if (@catch(result) == InputResult.NOT_AN_INT)
{
libc::printf("I didn't understand that.\n");
err_count++;