Skip to content

Commit 42a89b9

Browse files
diemogebhardtlpil
authored andcommitted
Refactor Uri.parse function to use Uri.empty constant
1 parent 0ebe035 commit 42a89b9

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/gleam/uri.gleam

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,7 @@ pub fn parse(uri_string: String) -> Result(Uri, Nil) {
8585
// TODO: This is not perfect and will be more permissive than its Erlang
8686
// counterpart, ideally we want to replicate Erlang's implementation on the js
8787
// target as well.
88-
let default_pieces =
89-
Uri(
90-
scheme: None,
91-
userinfo: None,
92-
host: None,
93-
port: None,
94-
path: "",
95-
query: None,
96-
fragment: None,
97-
)
98-
99-
parse_scheme_loop(uri_string, uri_string, default_pieces, 0)
88+
parse_scheme_loop(uri_string, uri_string, empty, 0)
10089
}
10190

10291
fn parse_scheme_loop(

0 commit comments

Comments
 (0)