|
|
@@ -8,6 +8,7 @@
|
|
|
|
|
|
use crate::test::TestFn;
|
|
|
use std::char;
|
|
|
+use std::fmt::Write;
|
|
|
|
|
|
use idna::Errors;
|
|
|
|
|
|
@@ -160,8 +161,8 @@ fn unescape(input: &str) -> String {
|
|
|
match char::from_u32(((c1 * 16 + c2) * 16 + c3) * 16 + c4) {
|
|
|
Some(c) => output.push(c),
|
|
|
None => {
|
|
|
- output
|
|
|
- .push_str(&format!("\\u{:X}{:X}{:X}{:X}", c1, c2, c3, c4));
|
|
|
+ write!(&mut output, "\\u{:X}{:X}{:X}{:X}", c1, c2, c3, c4)
|
|
|
+ .expect("Could not write to output");
|
|
|
}
|
|
|
};
|
|
|
}
|