Skip to content

Commit 6b2f594

Browse files
committed
Implement Default for EscapedStr.
1 parent 59d558f commit 6b2f594

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
### Added
1111

1212
- Implement `defmt::Format` for `EscapedStr`, `EscapedStringFragment` and `StringUnescapeError`.
13+
- Implement `Default` for `EscapedStr` (returning an empty string).
1314

1415
## [v0.6.0] - 2024-08-07
1516

src/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ fn unescape_next_fragment(
9797
/// )
9898
/// .unwrap();
9999
/// ```
100-
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
100+
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
101101
#[serde(rename = "__serde_json_core_escaped_string__")]
102102
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
103103
pub struct EscapedStr<'a>(pub &'a str);

0 commit comments

Comments
 (0)