diff options
author | Tyler Murphy <tylerm@tylerm.dev> | 2023-07-05 22:02:34 -0400 |
---|---|---|
committer | Tyler Murphy <tylerm@tylerm.dev> | 2023-07-05 22:02:34 -0400 |
commit | 732d7d83068efb5a44ab185716d3ad0001c40f5a (patch) | |
tree | 5799073d937631ecd72dd442deb3b72be5e6afa8 /src/response.rs | |
parent | changes (diff) | |
download | http-732d7d83068efb5a44ab185716d3ad0001c40f5a.tar.gz http-732d7d83068efb5a44ab185716d3ad0001c40f5a.tar.bz2 http-732d7d83068efb5a44ab185716d3ad0001c40f5a.zip |
readme
Diffstat (limited to 'src/response.rs')
-rw-r--r-- | src/response.rs | 11 |
1 files changed, 6 insertions, 5 deletions
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<T: ToString + FromStr> Response<T> { } } - pub fn set_version(mut self, version: impl Into<Version>) -> Self { + pub fn set_version(&mut self, version: impl Into<Version>) -> &mut Self { self.version = version.into(); self } - pub fn set_status(mut self, status: impl Into<Status>) -> Self { + pub fn set_status(&mut self, status: impl Into<Status>) -> &mut Self { self.status = status.into(); self } - pub fn add_header(mut self, header: impl Into<Header>) -> Self { + pub fn add_header(&mut self, header: impl Into<Header>) -> &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<T>) -> &mut Self { + self.body = Some(body.into()); self } + } impl<T: ToString + FromStr> TryParse for Response<T> { |