We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi! I enjoy this package, thank you for making it.
I would like to construct a pathname then pass it into the URL.
I see that PathSegmentsMut is available but looks like it's purposefully not exposed. Was there a reason for that?
PathSegmentsMut
Just like we can join paths in the standard PathBuf, I would like to see something similar here for urls.
PathBuf
The text was updated successfully, but these errors were encountered:
I'm not sure I understand. You can call set_path, or use path_segments_mut to change the path of a URL https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=41051f540e7ac7828963c10cd8da4c1b
use url; use url::Url; fn main() { let mut url = Url::parse("http://example.com/path").unwrap(); // https://docs.rs/url/2.3.1/url/struct.Url.html#method.set_path url.set_path("/some/other/path"); println!("{:?}", url.as_str()); // https://docs.rs/url/2.3.1/url/struct.PathSegmentsMut.html url.path_segments_mut().unwrap().pop().push("img"); println!("{:?}", url.as_str()); }
Could you expand of what else you would need?
Sorry, something went wrong.
@valenting The API implies that the host must be defined and known ahead of time.
Instead, I would like PathSegmentsMut publicly exposed with pub keyword and exported out the main module.
pub
@waynevanson I don't understand. Can you create an example of what you'd like to be able to do?
No branches or pull requests
Hi! I enjoy this package, thank you for making it.
I would like to construct a pathname then pass it into the URL.
I see that
PathSegmentsMut
is available but looks like it's purposefully not exposed.Was there a reason for that?
Just like we can join paths in the standard
PathBuf
, I would like to see something similar here for urls.The text was updated successfully, but these errors were encountered: