aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Uri.zig
diff options
context:
space:
mode:
authorKrzysztof Wolicki <der.teufel.mail@gmail.com>2024-01-18 08:13:04 +0100
committerGitHub <noreply@github.com>2024-01-18 09:13:04 +0200
commit14efbbfd89c7e034436faa87a201a35324b9dff3 (patch)
treefae0a7a3b2e8fa7e3fbf8fb538cc4100bfacb4cb /lib/std/Uri.zig
parent6e5bdb5397b5ec5ff3dd6e3ca6f7f93a9b6bfde9 (diff)
downloadzig-14efbbfd89c7e034436faa87a201a35324b9dff3.tar.gz
zig-14efbbfd89c7e034436faa87a201a35324b9dff3.zip
std.Uri: change specifier for printing with scheme to semicolon `;`
Fetch: print scheme when suggesting adding a ref to git URIs
Diffstat (limited to 'lib/std/Uri.zig')
-rw-r--r--lib/std/Uri.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/Uri.zig b/lib/std/Uri.zig
index ff4f6fad8a..8b455c6c71 100644
--- a/lib/std/Uri.zig
+++ b/lib/std/Uri.zig
@@ -318,7 +318,7 @@ pub fn format(
) @TypeOf(writer).Error!void {
_ = options;
- const scheme = comptime std.mem.indexOf(u8, fmt, ":") != null or fmt.len == 0;
+ const scheme = comptime std.mem.indexOf(u8, fmt, ";") != null or fmt.len == 0;
const authentication = comptime std.mem.indexOf(u8, fmt, "@") != null or fmt.len == 0;
const authority = comptime std.mem.indexOf(u8, fmt, "+") != null or fmt.len == 0;
const path = comptime std.mem.indexOf(u8, fmt, "/") != null or fmt.len == 0;
@@ -850,7 +850,7 @@ test "format" {
};
var buf = std.ArrayList(u8).init(std.testing.allocator);
defer buf.deinit();
- try uri.format(":/?#", .{}, buf.writer());
+ try buf.writer().print("{;/?#}", .{uri});
try std.testing.expectEqualSlices(u8, "file:/foo/bar/baz", buf.items);
}