#url builder

4 messages · Page 1 of 1 (latest)

magic forum
#

url crate is used across ecosystem, but one problem (i have) with it is lack of builder-style constructor. something like:

Url::new(Proto::Https, "example.com", ["path"]);

how do you deal with it?

chilly lotus
#

most commonly people just use format! and parse()

magic forum
#

that's what i'm currently using, but i would prefer something more "type-safe", so it checks if e.g. host doesn't have any / which would affect path

thorny elbow