impl Default for PreEscaped (#371)
* impl Default for PreEscaped * Simplify assertion * Update CHANGELOG.md --------- Co-authored-by: Chris Wong <lambda.fairy@gmail.com>
This commit is contained in:
parent
0d1bc320d3
commit
34b3bc00ce
3 changed files with 15 additions and 0 deletions
|
@ -6,6 +6,8 @@
|
||||||
[#357](https://github.com/lambda-fairy/maud/pull/357)
|
[#357](https://github.com/lambda-fairy/maud/pull/357)
|
||||||
- Support `axum` v0.6 through `axum-core` v0.3
|
- Support `axum` v0.6 through `axum-core` v0.3
|
||||||
[#361](https://github.com/lambda-fairy/maud/pull/361)
|
[#361](https://github.com/lambda-fairy/maud/pull/361)
|
||||||
|
- Implement `Default` for `PreEscaped`
|
||||||
|
[#371](https://github.com/lambda-fairy/maud/pull/371)
|
||||||
|
|
||||||
## [0.24.0] - 2022-08-12
|
## [0.24.0] - 2022-08-12
|
||||||
|
|
||||||
|
|
|
@ -241,6 +241,12 @@ impl<T: AsRef<str> + Into<String>> From<PreEscaped<T>> for String {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<T: AsRef<str> + Default> Default for PreEscaped<T> {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self(Default::default())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// The literal string `<!DOCTYPE html>`.
|
/// The literal string `<!DOCTYPE html>`.
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
|
|
|
@ -130,3 +130,10 @@ fn prefer_render_over_display() {
|
||||||
"<display>"
|
"<display>"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn default() {
|
||||||
|
use maud::{Markup, PreEscaped};
|
||||||
|
assert_eq!(Markup::default().0, "");
|
||||||
|
assert_eq!(PreEscaped::<&'static str>::default().0, "");
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue