Skip to content

Commit e7c1093

Browse files
Felix "xq" Queißnerandrewrk
authored andcommitted
Renames Url.zig to Uri.zig
1 parent 08496aa commit e7c1093

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

lib/std/Url.zig renamed to lib/std/Uri.zig

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Implements URI parsing roughly adhering to <https://tools.ietf.org/html/rfc3986>.
22
//! Does not do perfect grammar and character class checking, but should be robust against URIs in the wild.
33

4-
const Url = @This();
4+
const Uri = @This();
55
const std = @import("std.zig");
66
const testing = std.testing;
77

@@ -97,8 +97,8 @@ pub const ParseError = error{ UnexpectedCharacter, InvalidFormat, InvalidPort };
9797
/// Parses the URI or returns an error.
9898
/// The return value will contain unescaped strings pointing into the
9999
/// original `text`. Each component that is provided, will be non-`null`.
100-
pub fn parse(text: []const u8) ParseError!Url {
101-
var uri = Url{
100+
pub fn parse(text: []const u8) ParseError!Uri {
101+
var uri = Uri{
102102
.scheme = null,
103103
.user = null,
104104
.password = null,
@@ -311,7 +311,7 @@ test "with port" {
311311
}
312312

313313
test "should fail gracefully" {
314-
try std.testing.expectEqual(@as(ParseError!Url, error.InvalidFormat), parse("foobar://"));
314+
try std.testing.expectEqual(@as(ParseError!Uri, error.InvalidFormat), parse("foobar://"));
315315
}
316316

317317
test "scheme" {
@@ -413,7 +413,7 @@ test "authority.IPv6" {
413413

414414
test "RFC example 1" {
415415
const uri = "foo://example.com:8042/over/there?name=ferret#nose";
416-
try std.testing.expectEqual(Url{
416+
try std.testing.expectEqual(Uri{
417417
.scheme = uri[0..3],
418418
.user = null,
419419
.password = null,
@@ -427,7 +427,7 @@ test "RFC example 1" {
427427

428428
test "RFX example 2" {
429429
const uri = "urn:example:animal:ferret:nose";
430-
try std.testing.expectEqual(Url{
430+
try std.testing.expectEqual(Uri{
431431
.scheme = uri[0..3],
432432
.user = null,
433433
.password = null,

lib/std/std.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub const Target = @import("target.zig").Target;
4242
pub const Thread = @import("Thread.zig");
4343
pub const Treap = @import("treap.zig").Treap;
4444
pub const Tz = tz.Tz;
45-
pub const Url = @import("Url.zig");
45+
pub const Uri = @import("Uri.zig");
4646

4747
pub const array_hash_map = @import("array_hash_map.zig");
4848
pub const atomic = @import("atomic.zig");

0 commit comments

Comments
 (0)