Closed TheNeikos closed 1 year ago
I've ran into this situation:
async fn handler( engine: impl TemplateEngine, ) -> impl IntoResponse { let key = "Template key"; let data = Person{ /* */ }; RenderHtml(key, engine, data); }
This renders nothing on the output and also produces no warnings!
Since RenderHtml is not marked #[must_use] the compiler happily ignored it and used the default return value of () as my IntoResponse implementation.
RenderHtml
#[must_use]
IntoResponse
Having #[must_use] here would at least tell me something is up, and fix the error. (Since ; is also fairly small and easy to miss)
;
Thats unfortunate. It was an oversight from me. It will be fixed on 1.0.0.
1.0.0
I've ran into this situation:
This renders nothing on the output and also produces no warnings!
Since
RenderHtml
is not marked#[must_use]
the compiler happily ignored it and used the default return value of () as myIntoResponse
implementation.Having
#[must_use]
here would at least tell me something is up, and fix the error. (Since;
is also fairly small and easy to miss)