-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
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
PathSegmentsMut has no finish method like UrlQuery #363
Comments
Would like to work on this, but don't really know how to implement properly, should I implement Target for PathSegmentsMut or create a specific finish() method for PathSegmentsMut, which will output an Url? |
@TitiAlone No, the |
Just worked on this today and here's the code I made (included the doc because it's important). /// Returns the URL reference the PathSegmentsMut was constructed with.
///
/// Example:
///
/// ```rust
/// use url::Url;
/// # use std::error::Error;
///
/// # fn run() -> Result<(), Box<Error>> {
/// let mut url = Url::parse("https://github.com/servo/rust-url/issues/363")?;
/// url.path_segments_mut()
/// .map_err(|_| "cannot be base")?
/// .clear()
/// .finish()
/// .query_pairs_mut()
/// // ...
/// .finish();
/// assert_eq!(url.as_str(), "https://github.com/");
/// # Ok(())
/// # }
/// # run().unwrap();
/// ```
pub fn finish(&mut self) -> &mut ::Url {
self.url
} This makes an error, not on
|
pub fn finish(self) -> &'a mut ::Url {
self.url
} |
tmccombs: Try by yourself, it will not work, because we would need |
You're right. I don't think it is unreasonable to change clear & comp. to take |
From seanmonstar/reqwest#150
/cc @OJFord
The text was updated successfully, but these errors were encountered: