~blainsmith/public-inbox

hare-clrfmt: Update for current Hare v1 APPLIED

Carlos Une: 1
 Update for current Hare

 1 files changed, 9 insertions(+), 9 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~blainsmith/public-inbox/patches/46895/mbox | git am -3
Learn more about email & git

[PATCH hare-clrfmt] Update for current Hare Export this patch

- bufio -> memio
- @noreturn -> never

Signed-off-by: Carlos Une <une@fastmail.fm>
---
 clrfmt/clrfmt.ha | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/clrfmt/clrfmt.ha b/clrfmt/clrfmt.ha
index 5711e81..d5f7caa 100644
--- a/clrfmt/clrfmt.ha
+++ b/clrfmt/clrfmt.ha
@@ -1,4 +1,4 @@
use bufio;
use memio;
use encoding::utf8;
use io;
use os;
@@ -70,23 +70,23 @@ export fn errorfln(s: style, c: color, fmt: str, args: fmt::field...) (io::error
    fprintf(s: style, c: color, os::stderr, fmt, args...);

export fn asprintf(s: style, c: color, fmt: str, args: fmt::field...) str = {
    let buf = bufio::dynamic(io::mode::WRITE);
    let buf = memio::dynamic();
    assert(fprintf(s: style, c: color, &buf, fmt, args...) is size);
    return strings::fromutf8_unsafe(bufio::buffer(&buf));
    return strings::fromutf8_unsafe(memio::buffer(&buf));
};

export fn bsprintf(s: style, c: color, buf: []u8, fmt: str, args: fmt::field...) str = {
	let sink = bufio::fixed(buf, io::mode::WRITE);
	let sink = memio::fixed(buf);
    let l = fprintf(s: style, c: color, &sink, fmt, args...)!;
	return strings::fromutf8_unsafe(buf[..l]);
};

export @noreturn fn fatalf(s: style, c: color, fmt: str, args: fmt::field...) void = {
export fn fatalf(s: style, c: color, fmt: str, args: fmt::field...) never = {
    fprintfln(s, c, os::stderr, fmt, args...)!;
    os::exit(255);
};

export @noreturn fn fatal(s: style, c: color, args: fmt::formattable...) void = {
export fn fatal(s: style, c: color, args: fmt::formattable...) never = {
    fprintln(s, c, os::stderr, args...)!;
    os::exit(255);
};
@@ -108,13 +108,13 @@ export fn errorln(s: style, c: color, args: fmt::formattable...) (io::error | si
	fprintln(s: style, c: color, os::stderr, args...);

export fn asprint(s: style, c: color, args: fmt::formattable...) str = {
	let buf = bufio::dynamic(io::mode::WRITE);
	let buf = memio::dynamic();
	assert(fprint(s: style, c: color, &buf, args...) is size);
	return strings::fromutf8_unsafe(bufio::buffer(&buf));
	return strings::fromutf8_unsafe(memio::buffer(&buf));
};

export fn bsprint(s: style, c: color, buf: []u8, args: fmt::formattable...) str = {
	let sink = bufio::fixed(buf, io::mode::WRITE);
	let sink = memio::fixed(buf);
	let l = fprint(s: style, c: color, &sink, args...)!;
	return strings::fromutf8_unsafe(buf[..l]);
};
-- 
2.39.2