~sircmpwn/hare-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2

[PATCH hare-message] message: more stdlib changes

Details
Message ID
<20230912090236.466501-1-ch@bitfehler.net>
DKIM signature
missing
Download raw message
Patch: +4 -4
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
Details
Message ID
<CVGTMOWOBL5G.H8HP8NT91KKH@taiga>
In-Reply-To
<20230912090236.466501-1-ch@bitfehler.net> (view parent)
DKIM signature
missing
Download raw message
Should we rewrite these to use bufio::scanner?
Details
Message ID
<CWLNX16L57WX.35L4JPYYOGAJH@taiga>
In-Reply-To
<20230912090236.466501-1-ch@bitfehler.net> (view parent)
DKIM signature
missing
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/hare-message
   97dfc95..047e511  master -> master
Reply to thread Export thread (mbox)