aboutsummaryrefslogtreecommitdiffstats
path: root/askama_escape
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--askama_escape/src/lib.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/askama_escape/src/lib.rs b/askama_escape/src/lib.rs
index 0222277..fcc36c6 100644
--- a/askama_escape/src/lib.rs
+++ b/askama_escape/src/lib.rs
@@ -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(), "");