Skip to content

Commit

Permalink
snapshots: Add handy Clone, Copy derivations
Browse files Browse the repository at this point in the history
Derive `Clone` for `Info`, as well as both `Clone` and `Copy` for `Kind`
and `Usage`, which allows for convenient manipulation of these types.

Signed-off-by: Christos Katsakioris <ckatsak@gmail.com>
  • Loading branch information
ckatsak authored and mxpv committed Nov 13, 2024
1 parent 857ace0 commit ac89daa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/snapshots/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub mod api {
}

/// Snapshot kinds.
#[derive(Debug, Serialize, Deserialize, PartialEq, Default)]
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Default)]
pub enum Kind {
#[default]
Unknown,
Expand All @@ -59,7 +59,7 @@ pub enum Kind {
}

/// Information about a particular snapshot.
#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Info {
/// Active or committed snapshot.
pub kind: Kind,
Expand Down Expand Up @@ -92,7 +92,7 @@ impl Default for Info {
///
// These resources only include the resources consumed by the snapshot itself and does not include
// resources usage by the parent.
#[derive(Debug, Default)]
#[derive(Debug, Clone, Copy, Default)]
pub struct Usage {
/// Number of inodes in use.
pub inodes: i64,
Expand Down

0 comments on commit ac89daa

Please sign in to comment.