hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit e15431c81b810cbf8040832fd43173585ec350cb
parent 9db5898c0e901560f5a1d71e14d5319124369ef9
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sat,  8 Jan 2022 10:05:00 +0100

pathbuf: use fromutf8_unsafe

We can be certain that the path will always be valid UTF-8 because the
inputs are always str.

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Mpathbuf/buffer.ha | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pathbuf/buffer.ha b/pathbuf/buffer.ha @@ -57,7 +57,7 @@ export fn dup_static(new: *buffer, old: *buffer) void = { // components, or repeated path separators (e.g. "/usr//bin/../bin/./hare" // becomes "/usr/bin/hare"). export fn path(buf: *buffer) str = { - return strings::fromutf8(buf.cur); + return strings::fromutf8_unsafe(buf.cur); }; // Overwrites the contents of a [[buffer]] with an arbitrary path.