authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-11-28 22:44:37-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-01-01 17:51:18-07:00
log1a3e0d6709cec285045ff95911a5b961151c8efe
treea1ab6d7511f74dbff62509ea90a951fd1f72d7dc
parent2b589783602c5428ecde9dbb3f41a81f85eb0f25

std.Uri: default some fields to null

so that it becomes practical to initialize Uri objects directly rather than relying on unnecessary text parsing.

1 files changed, 6 insertions(+), 6 deletions(-)

lib/std/Uri.zig+6-6
...@@ -6,13 +6,13 @@ const std = @import("std.zig");...@@ -6,13 +6,13 @@ const std = @import("std.zig");
6const testing = std.testing;6const testing = std.testing;
77
8scheme: []const u8,8scheme: []const u8,
9user: ?[]const u8,9user: ?[]const u8 = null,
10password: ?[]const u8,10password: ?[]const u8 = null,
11host: ?[]const u8,11host: ?[]const u8 = null,
12port: ?u16,12port: ?u16 = null,
13path: []const u8,13path: []const u8,
14query: ?[]const u8,14query: ?[]const u8 = null,
15fragment: ?[]const u8,15fragment: ?[]const u8 = null,
1616
17/// Applies URI encoding and replaces all reserved characters with their respective %XX code.17/// Applies URI encoding and replaces all reserved characters with their respective %XX code.
18pub fn escapeString(allocator: std.mem.Allocator, input: []const u8) error{OutOfMemory}![]u8 {18pub fn escapeString(allocator: std.mem.Allocator, input: []const u8) error{OutOfMemory}![]u8 {