4 ms·
Ok(Response::new_html(StatusCode::OK, Body::fixed(rendered))) no thank you. if you like it good for you, for me this looks worse than Body body = BodyFactory.
by singularity2001 2y ago
Ok(Response::new_html(StatusCode::OK, Body::fixed(rendered)))
no thank you. if you like it good for you, for me this looks worse than
Body body = BodyFactory.newInstance(BodyConfiguration.OK)
which is still SHORTHER and less cancer
- orangeboats 2y agoYour BodyFactory example isn't even functionally the same as the quoted code snippet. Nowhere is the Body::fixed(rendered) equivalent seen, for example.
- m4tx 2y agoThat's one of the issues explicitly mentioned in the article ("Request Handler API is far from being ergonomic"). This will get better in the nearest future as it's a major pain point, I'm just thinking of the best API for doing request/responses.