Skip to content

Commit

Permalink
chore(core::writing): Text::set_header -> Text::append_header
Browse files Browse the repository at this point in the history
  • Loading branch information
andeya committed Oct 8, 2024
1 parent 7d48bc0 commit 8bb0e52
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/core/src/writing/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl<C> Text<C>
where
C: AsRef<str>,
{
fn set_header(self, res: &mut Response) -> C {
fn append_header(self, res: &mut Response) -> C {
let (ctype, content) = match self {
Self::Plain(content) => (
HeaderValue::from_static("text/plain; charset=utf-8"),
Expand Down Expand Up @@ -88,21 +88,21 @@ where
impl Scribe for Text<&'static str> {
#[inline]
fn render(self, res: &mut Response) {
let content = self.set_header(res);
let content = self.append_header(res);
let _ = res.write_body(content);
}
}
impl Scribe for Text<String> {
#[inline]
fn render(self, res: &mut Response) {
let content = self.set_header(res);
let content = self.append_header(res);
let _ = res.write_body(content);
}
}
impl Scribe for Text<&String> {
#[inline]
fn render(self, res: &mut Response) {
let content = self.set_header(res);
let content = self.append_header(res);
let _ = res.write_body(content.as_bytes().to_vec());
}
}
Expand Down

0 comments on commit 8bb0e52

Please sign in to comment.