Skip to content
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

Add path_mut #7

Closed
reem opened this issue Aug 8, 2014 · 3 comments
Closed

Add path_mut #7

reem opened this issue Aug 8, 2014 · 3 comments

Comments

@reem
Copy link

reem commented Aug 8, 2014

Add a path_mut method, which provides a mutable reference to the requested path. This is important for things like a Mounting middleware, which need to be able to modify the url.

@Valve
Copy link

Valve commented Aug 8, 2014

+1, it's unclear how to update path after URL parsing. In my app I'm storing the base URL and updating the path depending on what I need to do.

This is what I'm currently doing to update the path:

fn update_url(baseUrl: &Url) -> Url{
  let mut url_parser = UrlParser::new();
  url_parser.base_url(baseUrl).parse("./update").unwrap()
}

@SimonSapin
Copy link
Member

I find it very unfortunate that we have to duplicate accessors rather make them generic over mutability, but I guess that’s what we’re stuck with for now.

@Valve
Copy link

Valve commented Aug 8, 2014

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants