aports/testing/powerctl/new-hare-strings.patch
2023-09-19 05:33:07 +00:00

37 lines
1.2 KiB
Diff

Patch-Source: https://git.sr.ht/~sircmpwn/powerctl/commit/1c30fc759f5999718e810e69e7d05658030c1373
--
From 1c30fc759f5999718e810e69e7d05658030c1373 Mon Sep 17 00:00:00 2001
From: Carlos Une <une@fastmail.fm>
Date: Sun, 16 Oct 2022 00:12:02 -0300
Subject: [PATCH] Fix build with Hare ^HEAD
Signed-off-by: Carlos Une <une@fastmail.fm>
---
sysfs.ha | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sysfs.ha b/sysfs.ha
index 5cf9591..3473086 100644
--- a/sysfs.ha
+++ b/sysfs.ha
@@ -41,7 +41,7 @@ fn read_states(path: str) (strings::tokenizer | fs::error | io::error) = {
case =>
abort("Unexpected EOF from sysfs");
};
- const string = strings::rtrim(strings::fromutf8(buf[..z]), '\n');
+ const string = strings::rtrim(strings::fromutf8(buf[..z])!, '\n');
return strings::tokenize(string, " ");
};
@@ -255,7 +255,7 @@ fn read_image_size() (size | fs::error | io::error) = {
abort("Unexpected EOF from /sys/power/image_size");
};
- const val = strings::rtrim(strings::fromutf8(buf[..z]), '\n');
+ const val = strings::rtrim(strings::fromutf8(buf[..z])!, '\n');
match (strconv::stoz(val)) {
case let z: size =>
return z;
--
2.38.4