You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wanting to take an url I have already and replace the PathAndQuery part, or make a new url with a new PathAndQuery. But that seems impossible as making a PathAndQuery requires a static str. So you can't use format!("files/{}", file_name).as_str() to make a PathAndQuery.
Basically I gave up and will just build it up as a string, then parse with Uri::try_from().
Am I doing it wrong? It seems like the Uri api is trying to give me an interface for building/remixing uris from Parts, but due to static lifetimes its not quite usable.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm wanting to take an url I have already and replace the PathAndQuery part, or make a new url with a new PathAndQuery. But that seems impossible as making a PathAndQuery requires a static str. So you can't use format!("files/{}", file_name).as_str() to make a PathAndQuery.
Basically I gave up and will just build it up as a string, then parse with Uri::try_from().
Am I doing it wrong? It seems like the Uri api is trying to give me an interface for building/remixing uris from Parts, but due to static lifetimes its not quite usable.
Beta Was this translation helpful? Give feedback.
All reactions