Skip to content

Commit

Permalink
allow Session cookie value to be cloned
Browse files Browse the repository at this point in the history
  • Loading branch information
jbr committed Mar 30, 2023
1 parent 60aaa4f commit 493fa04
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ use time::OffsetDateTime as DateTime;
/// assert!(session.data_changed());
/// # Ok(()) }) }
/// ```
#[derive(Debug, Serialize, Deserialize)]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Session {
id: String,
expiry: Option<DateTime>,
Expand All @@ -63,19 +63,6 @@ pub struct Session {
destroy: bool,
}

impl Clone for Session {
fn clone(&self) -> Self {
Self {
cookie_value: None,
id: self.id.clone(),
data: self.data.clone(),
expiry: self.expiry,
destroy: self.destroy,
data_changed: self.data_changed,
}
}
}

impl Default for Session {
fn default() -> Self {
Self::new()
Expand Down

0 comments on commit 493fa04

Please sign in to comment.