Skip to content

Commit

Permalink
fix redis-rs#1045: impl Clone/Copy for SetOptions (redis-rs#1046)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadbky authored Feb 3, 2024
1 parent ff3ed30 commit cc32c77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion redis/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2098,7 +2098,7 @@ impl ToRedisArgs for Direction {
/// con.set_options(key, value, opts)
/// }
/// ```
#[derive(Default)]
#[derive(Clone, Copy, Default)]
pub struct SetOptions {
conditional_set: Option<ExistenceCheck>,
get: bool,
Expand Down
2 changes: 2 additions & 0 deletions redis/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pub enum Expiry {
}

/// Helper enum that is used to define expiry time for SET command
#[derive(Clone, Copy)]
pub enum SetExpiry {
/// EX seconds -- Set the specified expire time, in seconds.
EX(usize),
Expand All @@ -60,6 +61,7 @@ pub enum SetExpiry {
}

/// Helper enum that is used to define existence checks
#[derive(Clone, Copy)]
pub enum ExistenceCheck {
/// NX -- Only set the key if it does not already exist.
NX,
Expand Down

0 comments on commit cc32c77

Please sign in to comment.