State in Rocket 0.5.1 and Rust 2024 edition #2917
-
hi there, i'm trying to make my server work w/ Rust 1.85.0 (2024 edition) but i'm having trouble when a handler is expected to return something like...
the code in question is here and the compiler's hint is as follows...
the diagnostic message for the last hint shows
at first i thought it's due to my use of Result<EitherOr<impl Stream<Item = MultipartSection<'r>>>, Status> and assigning a lifetime to the handler like so async fn get_more<r>(...) does not solve the issue most likely b/c rocket::state
pub struct State<T>(T)
where
T: Send + Sync + 'static, if that makes sense, any suggestions on how to migrate this handler to the 2024 edition is appreciated. TIA + cheers; |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Following up on my initial post, it looks like it's too early to switch my server to the 2024 edition. The best i can do for now is to add Result<EitherOr<impl Stream<Item = MultipartSection<'static>> + use<>>, Status> { solves the issue. |
Beta Was this translation helpful? Give feedback.
Following up on my initial post, it looks like it's too early to switch my server to the 2024 edition.
The best i can do for now is to add
#![warn(rust_2024_compatibility)]
to thelib.rs
and fix the warnings that are emitted. Specifically for the handler i mentioned in my initial post changing the return type to...solves the issue.