Skip to content

Commit

Permalink
Refactor Uri module to use Uri.empty constant
Browse files Browse the repository at this point in the history
  • Loading branch information
diemogebhardt committed Jan 9, 2025
1 parent 68f765f commit 55548ad
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/gleam/uri.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,7 @@ pub fn parse(uri_string: String) -> Result(Uri, Nil) {
// TODO: This is not perfect and will be more permissive than its Erlang
// counterpart, ideally we want to replicate Erlang's implementation on the js
// target as well.
let default_pieces =
Uri(
scheme: None,
userinfo: None,
host: None,
port: None,
path: "",
query: None,
fragment: None,
)

parse_scheme_loop(uri_string, uri_string, default_pieces, 0)
parse_scheme_loop(uri_string, uri_string, empty, 0)
}

fn parse_scheme_loop(
Expand Down

0 comments on commit 55548ad

Please sign in to comment.