hare

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

commit 6486722b49c3924585c5f86b16489b75c2b595c5
parent 19df031698ec34c2c3f398df8ba58a6f257f2c30
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sat,  8 Jan 2022 14:32:42 +0100

path: remove redundant namespace usage

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

Diffstat:
Mpath/buffer.ha | 18++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/path/buffer.ha b/path/buffer.ha @@ -48,11 +48,13 @@ export fn dup(buf: *buffer) buffer = { // // let buf = path::init(); // path::set(&buf, "foo", "bar")!; -// assert(string(&buf) == "foo/bar"); +// assert(path::string(&buf) == "foo/bar"); +// // path::set(&buf, "foo", "bar/")!; -// assert(string(&buf) == "foo/bar/"); +// assert(path::string(&buf) == "foo/bar/"); +// // path::set(&buf, "foo", "bar", "/")!; -// assert(string(&buf) == "foo/bar/"); +// assert(path::string(&buf) == "foo/bar/"); export fn string(buf: *buffer) str = { const value = strings::fromutf8_unsafe(buf.cur); if (value == "") { @@ -181,13 +183,13 @@ fn doappend(buf: *buffer, elem: []u8) (void | errors::overflow) = { appendnorm(&buf, "..")!; assert(string(&buf) == "../.."); - let buf = path::init(); - path::set(&buf, "foo", "bar")!; + let buf = init(); + set(&buf, "foo", "bar")!; assert(string(&buf) == "foo/bar"); - path::set(&buf, "foo", "bar/")!; + set(&buf, "foo", "bar/")!; assert(string(&buf) == "foo/bar/"); - path::set(&buf, "foo", "bar", "/")!; + set(&buf, "foo", "bar", "/")!; assert(string(&buf) == "foo/bar/"); - path::add(&buf, "/baz")!; + add(&buf, "/baz")!; assert(string(&buf) == "foo/bar/baz"); };