M haredoc.ha => haredoc.ha +5 -5
@@ 39,7 39,7 @@ fn handle_haredoc(
let decls: []ast::decl = [];
defer {
for (let i = 0z; i < len(decls); i += 1) {
- ast::decl_free(decls[i]);
+ ast::decl_finish(decls[i]);
};
free(decls);
};
@@ 94,10 94,10 @@ fn handle_haredoc(
};
const buf = strio::dynamic();
- unparse_hare(buf, *selected)!;
- fmt::fprintf(buf, " // https://docs.harelang.org/{}#{}", path, decl)!;
- const resp = strio::finish(buf);
- defer free(resp);
+ defer free(&buf);
+ unparse_hare(&buf, *selected)!;
+ fmt::fprintf(&buf, " // https://docs.harelang.org/{}#{}", path, decl)!;
+ const resp = strio::string(&buf);
irc::privmsg(state.conn, resp, msg.params[0])!;
};
M main.ha => main.ha +1 -1
@@ 33,7 33,7 @@ export fn main() void = {
fmt::fatal("Failed to dial IRC server: {}",
irc::strerror(err));
};
- defer irc::close(conn);
+ defer irc::close(conn)!;
const chan = irc::join(conn, channel)!;
let state = state {