mirror of
https://github.com/askama-rs/askama.git
synced 2025-09-28 13:30:59 +00:00
Add no_std support to askama_escape
This commit is contained in:
parent
000aff4a18
commit
54a2046edc
@ -1,5 +1,10 @@
|
||||
use std::fmt::{self, Display, Formatter, Write};
|
||||
use std::str;
|
||||
#![no_std]
|
||||
|
||||
#[cfg(test)]
|
||||
extern crate std;
|
||||
|
||||
use core::fmt::{self, Display, Formatter, Write};
|
||||
use core::str;
|
||||
|
||||
pub struct MarkupDisplay<E, T>
|
||||
where
|
||||
@ -88,7 +93,7 @@ where
|
||||
escaper: E,
|
||||
}
|
||||
|
||||
impl<'a, E> ::std::fmt::Display for Escaped<'a, E>
|
||||
impl<'a, E> Display for Escaped<'a, E>
|
||||
where
|
||||
E: Escaper,
|
||||
{
|
||||
@ -168,6 +173,8 @@ const FLAG: u8 = b'>' - b'"';
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use std::string::ToString;
|
||||
|
||||
#[test]
|
||||
fn test_escape() {
|
||||
assert_eq!(escape("", Html).to_string(), "");
|
||||
|
Loading…
x
Reference in New Issue
Block a user