Skip to content

Commit

Permalink
feat: implement Clone for HeaderAndClaims. (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
bittrance authored May 30, 2024
1 parent dc0764c commit 9cd5cc1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub mod jwk;

/// JWT header.
#[non_exhaustive]
#[derive(Debug, Serialize, Deserialize, Default)]
#[derive(Clone, Debug, Serialize, Deserialize, Default)]
pub struct Header {
#[serde(skip_serializing_if = "Option::is_none")]
pub typ: Option<String>,
Expand Down Expand Up @@ -113,7 +113,7 @@ impl<'a, T> Iterator for OneOrManyIter<'a, T> {
#[serde_as]
#[skip_serializing_none]
#[non_exhaustive]
#[derive(Debug, Serialize, Default, Deserialize)]
#[derive(Clone, Debug, Serialize, Default, Deserialize)]
pub struct Claims<ExtraClaims> {
#[serde_as(as = "Option<serde_with::DurationSeconds<f64>>")]
pub exp: Option<Duration>,
Expand All @@ -139,7 +139,7 @@ pub struct Claims<ExtraClaims> {
/// Use `serde_json::Map<String, Value>` for dynamic claims.
///
/// Or define your own claims type which implements `Serialize`/`Deserialize`.
#[derive(Default, Debug)]
#[derive(Clone, Default, Debug)]
pub struct HeaderAndClaims<ExtraClaims> {
header: Header,
claims: Claims<ExtraClaims>,
Expand Down

0 comments on commit 9cd5cc1

Please sign in to comment.