~sircmpwn/hare-dev

hare-message: message: more stdlib changes v1 APPLIED

Conrad Hoffmann: 1
 message: more stdlib changes

 1 files changed, 4 insertions(+), 4 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/~sircmpwn/hare-dev/patches/44599/mbox | git am -3
Learn more about email & git

[PATCH hare-message] message: more stdlib changes Export this patch

Signed-off-by: Conrad Hoffmann <ch@bitfehler.net>
---
 message/header.ha | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/message/header.ha b/message/header.ha
index 51d46a8..f3d7ff5 100644
--- a/message/header.ha
+++ b/message/header.ha
@@ -316,7 +316,7 @@ export fn read_header(
	// TODO: leaks on error
	let head = new_header();

	match (bufio::scanbyte(&rd)?) {
	match (bufio::read_byte(&rd)?) {
	case let b: u8 =>
		// Cannot start with a leading space
		if (b == ' ' || b == '\t') {
@@ -636,7 +636,7 @@ fn write_continued(sink: *memio::stream, v: []u8) void = {
fn read_continued(
	rd: *bufio::stream,
) ([]u8 | errors::invalid | io::error) = {
	let line = match (bufio::scanline(rd)?) {
	let line = match (bufio::read_line(rd)?) {
	case let line: []u8 =>
		yield bytes::rtrim(line, '\r');
	case io::EOF =>
@@ -649,7 +649,7 @@ fn read_continued(
	append(line, ['\r', '\n']...);

	for (has_continuation(rd)?) {
		const cont = match (bufio::scanline(rd)?) {
		const cont = match (bufio::read_line(rd)?) {
		case let line: []u8 =>
			yield bytes::rtrim(line, '\r');
		case io::EOF =>
@@ -667,7 +667,7 @@ fn read_continued(
fn has_continuation(
	rd: *bufio::stream,
) (bool | io::error) = {
	const b = match (bufio::scanbyte(rd)?) {
	const b = match (bufio::read_byte(rd)?) {
	case let b: u8 =>
		yield b;
	case io::EOF =>
-- 
2.42.0
Thanks!

To git@git.sr.ht:~sircmpwn/hare-message
   97dfc95..047e511  master -> master
Should we rewrite these to use bufio::scanner?