Skip to content

Commit

Permalink
FastWritable data marked as |e should be FastWritable
Browse files Browse the repository at this point in the history
  • Loading branch information
Kijewski committed Aug 5, 2024
1 parent cb4f01d commit d4a58b9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions rinja/src/filters/escape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,11 @@ const _: () = {
NeedsEscaping(&'a T, E),
}

impl<T: AsRef<str> + ?Sized, E: Escaper> FastWritable for Wrapped<'_, T, E> {
#[inline]
impl<T: FastWritable + ?Sized, E: Escaper> FastWritable for Wrapped<'_, T, E> {
fn write_into<W: fmt::Write + ?Sized>(&self, dest: &mut W) -> fmt::Result {
match self {
Wrapped::Safe(t) => dest.write_str(t.as_ref()),
Wrapped::NeedsEscaping(t, e) => e.write_escaped_str(dest, t.as_ref()),
match *self {
Wrapped::Safe(t) => t.write_into(dest),
Wrapped::NeedsEscaping(t, e) => EscapeDisplay(t, e).write_into(dest),
}
}
}
Expand Down

0 comments on commit d4a58b9

Please sign in to comment.