From 1a3e0d6709cec285045ff95911a5b961151c8efe Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 28 Nov 2023 22:44:37 -0700 Subject: [PATCH] std.Uri: default some fields to null so that it becomes practical to initialize Uri objects directly rather than relying on unnecessary text parsing. --- lib/std/Uri.zig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/std/Uri.zig b/lib/std/Uri.zig index a88a102bd4..c79007b87a 100644 --- a/lib/std/Uri.zig +++ b/lib/std/Uri.zig @@ -6,13 +6,13 @@ const std = @import("std.zig"); const testing = std.testing; scheme: []const u8, -user: ?[]const u8, -password: ?[]const u8, -host: ?[]const u8, -port: ?u16, +user: ?[]const u8 = null, +password: ?[]const u8 = null, +host: ?[]const u8 = null, +port: ?u16 = null, path: []const u8, -query: ?[]const u8, -fragment: ?[]const u8, +query: ?[]const u8 = null, +fragment: ?[]const u8 = null, /// Applies URI encoding and replaces all reserved characters with their respective %XX code. pub fn escapeString(allocator: std.mem.Allocator, input: []const u8) error{OutOfMemory}![]u8 {