mirror of
https://github.com/askama-rs/askama.git
synced 2025-10-03 15:55:31 +00:00
Implement HtmlSafe
for all reference wrappers
This commit is contained in:
parent
34f18e6293
commit
216836e08f
@ -466,16 +466,6 @@ mark_html_safe! {
|
|||||||
std::num::NonZeroU64, std::num::NonZeroU128, std::num::NonZeroUsize,
|
std::num::NonZeroU64, std::num::NonZeroU128, std::num::NonZeroUsize,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: HtmlSafe + ?Sized> HtmlSafe for &T {}
|
|
||||||
impl<T: HtmlSafe + ?Sized> HtmlSafe for Box<T> {}
|
|
||||||
impl<T: HtmlSafe + ?Sized> HtmlSafe for std::cell::Ref<'_, T> {}
|
|
||||||
impl<T: HtmlSafe + ?Sized> HtmlSafe for std::cell::RefMut<'_, T> {}
|
|
||||||
impl<T: HtmlSafe + ?Sized> HtmlSafe for std::rc::Rc<T> {}
|
|
||||||
impl<T: HtmlSafe + ?Sized> HtmlSafe for std::pin::Pin<&T> {}
|
|
||||||
impl<T: HtmlSafe + ?Sized> HtmlSafe for std::sync::Arc<T> {}
|
|
||||||
impl<T: HtmlSafe + ?Sized> HtmlSafe for std::sync::MutexGuard<'_, T> {}
|
|
||||||
impl<T: HtmlSafe + ?Sized> HtmlSafe for std::sync::RwLockReadGuard<'_, T> {}
|
|
||||||
impl<T: HtmlSafe + ?Sized> HtmlSafe for std::sync::RwLockWriteGuard<'_, T> {}
|
|
||||||
impl<T: HtmlSafe> HtmlSafe for std::num::Wrapping<T> {}
|
impl<T: HtmlSafe> HtmlSafe for std::num::Wrapping<T> {}
|
||||||
impl<T: fmt::Display> HtmlSafe for HtmlSafeOutput<T> {}
|
impl<T: fmt::Display> HtmlSafe for HtmlSafeOutput<T> {}
|
||||||
|
|
||||||
@ -486,6 +476,12 @@ where
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
crate::impl_for_ref! {
|
||||||
|
impl HtmlSafe for T {}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T: HtmlSafe> HtmlSafe for Pin<T> {}
|
||||||
|
|
||||||
/// Used internally by rinja to select the appropriate [`write!()`] mechanism
|
/// Used internally by rinja to select the appropriate [`write!()`] mechanism
|
||||||
pub struct Writable<'a, S: ?Sized>(pub &'a S);
|
pub struct Writable<'a, S: ?Sized>(pub &'a S);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user