Skip to content

Commit 533fccd

Browse files
authored
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 <rust-lang/rust#115010> = note: this warning originates in the attribute macro `server` (in Nightly builds, run with -Z macro-backtrace for more info)
1 parent ec4bd76 commit 533fccd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server_fn_macro/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ pub fn server_macro_impl(
281281
}
282282

283283
impl #struct_name {
284-
const URL: &str = if #fn_path.is_empty() {
284+
const URL: &'static str = if #fn_path.is_empty() {
285285
#server_fn_path::const_format::concatcp!(
286286
#fn_name_as_str,
287287
#server_fn_path::xxhash_rust::const_xxh64::xxh64(
@@ -292,7 +292,7 @@ pub fn server_macro_impl(
292292
} else {
293293
#fn_path
294294
};
295-
const PREFIX: &str = #prefix;
295+
const PREFIX: &'static str = #prefix;
296296
const ENCODING: #server_fn_path::Encoding = #encoding;
297297
}
298298

0 commit comments

Comments
 (0)