commit 3c8a71297f7d74eb18f05aae75d9cfb06e79df0a
parent fcc694467fdf1313615dcad31740c96a632c1091
Author: Drew DeVault <sir@cmpwn.com>
Date: Sat, 8 Jan 2022 17:35:28 +0100
pwd: use const where appropriate
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pwd.ha b/pwd.ha
@@ -45,12 +45,12 @@ export fn utilmain() (main::error | void) = {
fmt::println(path)?;
};
-// Reads all links in a path.
+// Reads all links in a path. The return value is statically allocated.
fn resolvelinks(path: str) (str | fs::error) = {
static let buf = path::buffer { ... };
path::reset(&buf);
- let iter = path::iter(path);
+ const iter = path::iter(path);
for (true) {
const item = match (path::next(&iter)) {
case let item: str =>