-
I was first going to post a bug report that if I use uri! on a function that is mounted on a different prefix, the macro returns the wrong url. Well its a macro so it makes sense. But then I said to prevent using two values, let me define a constant. But if I use the constant &str inside a uri!(constant, ...) it does not compile! Any alternative?
|
Beta Was this translation helpful? Give feedback.
Answered by
elibroftw
Dec 7, 2022
Replies: 1 comment
-
I experimented and got this use rocket::http::uri::Origin;
// OLD const TAURI_UPDATER_PREFIX: &str = "/tauri-releases";
const TAURI_UPDATER_PREFIX: Origin<'static> = uri!("/tauri-releases");
...
Redirect::to(uri!(TAURI_UPDATER_PREFIX, google_keep_desktop_api("win64", "1.18.0")))
...
.mount(TAURI_UPDATER_PREFIX, routes![google_keep_desktop_api]) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
elibroftw
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I experimented and got this