Open
Description
When building a URL, it would be convenient to be able to
finish
mutating path segments like one currently can for query pairs.// will NOT compile let mut url = Url::parse("..."); url .path_segments_mut().unwrap() // ... .query_pairs_mut() // ... .finish() // ...Instead the query pairs must be mutated first, since this 'sub builder' can be
finish
ed, returning aUrl
. Which (though slightly counter-intuitive) is fine, it's just a slightly jarring restriction.It also means the mutable variable is necessary; if it behaved like
query_pairs_mut
then this could all be on one chain which could be passed directly (or via an immutable variable) into aClient
method.
From seanmonstar/reqwest#150
/cc @OJFord