Skip to content

Commit 9cd5cc1

Browse files
authored
feat: implement Clone for HeaderAndClaims. (#12)
1 parent dc0764c commit 9cd5cc1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub mod jwk;
3535

3636
/// JWT header.
3737
#[non_exhaustive]
38-
#[derive(Debug, Serialize, Deserialize, Default)]
38+
#[derive(Clone, Debug, Serialize, Deserialize, Default)]
3939
pub struct Header {
4040
#[serde(skip_serializing_if = "Option::is_none")]
4141
pub typ: Option<String>,
@@ -113,7 +113,7 @@ impl<'a, T> Iterator for OneOrManyIter<'a, T> {
113113
#[serde_as]
114114
#[skip_serializing_none]
115115
#[non_exhaustive]
116-
#[derive(Debug, Serialize, Default, Deserialize)]
116+
#[derive(Clone, Debug, Serialize, Default, Deserialize)]
117117
pub struct Claims<ExtraClaims> {
118118
#[serde_as(as = "Option<serde_with::DurationSeconds<f64>>")]
119119
pub exp: Option<Duration>,
@@ -139,7 +139,7 @@ pub struct Claims<ExtraClaims> {
139139
/// Use `serde_json::Map<String, Value>` for dynamic claims.
140140
///
141141
/// Or define your own claims type which implements `Serialize`/`Deserialize`.
142-
#[derive(Default, Debug)]
142+
#[derive(Clone, Default, Debug)]
143143
pub struct HeaderAndClaims<ExtraClaims> {
144144
header: Header,
145145
claims: Claims<ExtraClaims>,

0 commit comments

Comments
 (0)