maud icon indicating copy to clipboard operation
maud copied to clipboard

Add support for Ntex

Open dvdmgl opened this issue 3 months ago • 1 comments

This PR adds support for the Ntex framework.

dvdmgl avatar Sep 18 '25 02:09 dvdmgl

I'm suggesting to call the String implementation, instead of duplicating it.

On Mon, Sep 29, 2025, 01:52 David Miguel @.***> wrote:

@.**** commented on this pull request.

In maud/src/lib.rs https://github.com/lambda-fairy/maud/pull/482#discussion_r2386163432:

  •        if self.0.is_empty() {
    
  •            Poll::Ready(None)
    
  •        } else {
    
  •            Poll::Ready(Some(Ok(Bytes::from(mem::take(&mut self.0).into_bytes()))))
    
  •        }
    

The implementation follows ntex impl MessageBody for String https://github.com/ntex-rs/ntex/blob/6d1aa23d929c485710643ae78abbf3f03d4b7514/ntex-http/src/body.rs#L383, avoiding unnecessary allocations and one-shot consumption of the body, performance wise it's the best.

— Reply to this email directly, view it on GitHub https://github.com/lambda-fairy/maud/pull/482#discussion_r2386163432, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAL73Y3NVJQAAVKWA6NVS2L3U773XAVCNFSM6AAAAACG2FFTS6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTENZXGEYTSMBUGI . You are receiving this because you commented.Message ID: @.***>

lambda-fairy avatar Sep 28 '25 16:09 lambda-fairy