fix: nightly warning in server macro for lifetime (#1580)

On the latest lifetime we're getting the following warning in the server
macro:
 warning: `&` without an explicit lifetime name cannot be used here
   --> src/login.rs:19:1
    |
 19 | #[server(Login, "/api")]
    | ^
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #115010 <https://github.com/rust-lang/rust/issues/115010>
    = note: this warning originates in the attribute macro `server` (in Nightly builds, run with -Z macro-backtrace for more info)
This commit is contained in:
Mark Catley 2023-08-24 22:30:13 +12:00 committed by GitHub
parent ec4bd7600f
commit 533fccd1d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -281,7 +281,7 @@ pub fn server_macro_impl(
}
impl #struct_name {
const URL: &str = if #fn_path.is_empty() {
const URL: &'static str = if #fn_path.is_empty() {
#server_fn_path::const_format::concatcp!(
#fn_name_as_str,
#server_fn_path::xxhash_rust::const_xxh64::xxh64(
@ -292,7 +292,7 @@ pub fn server_macro_impl(
} else {
#fn_path
};
const PREFIX: &str = #prefix;
const PREFIX: &'static str = #prefix;
const ENCODING: #server_fn_path::Encoding = #encoding;
}