From 732d7d83068efb5a44ab185716d3ad0001c40f5a Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Wed, 5 Jul 2023 22:02:34 -0400 Subject: readme --- src/response.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/response.rs') diff --git a/src/response.rs b/src/response.rs index 7f6f326..dd25d6e 100644 --- a/src/response.rs +++ b/src/response.rs @@ -18,25 +18,26 @@ impl Response { } } - pub fn set_version(mut self, version: impl Into) -> Self { + pub fn set_version(&mut self, version: impl Into) -> &mut Self { self.version = version.into(); self } - pub fn set_status(mut self, status: impl Into) -> Self { + pub fn set_status(&mut self, status: impl Into) -> &mut Self { self.status = status.into(); self } - pub fn add_header(mut self, header: impl Into
) -> Self { + pub fn add_header(&mut self, header: impl Into
) -> &mut Self { self.headers.insert(header.into()); self } - pub fn set_body(mut self, body: T) -> Self { - self.body = Some(body); + pub fn set_body(&mut self, body: impl Into) -> &mut Self { + self.body = Some(body.into()); self } + } impl TryParse for Response { -- cgit v1.2.3-freya