Skip to content

Commit 90cbad4

Browse files
committed
refactor: derive Clone, Copy for SnapshotType
Passing this enough around by reference was making for awkward dereferencing when comparing. Signed-off-by: Patrick Roy <[email protected]>
1 parent 94ffe08 commit 90cbad4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/vmm/src/persist.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ pub fn create_snapshot(
200200
version_map,
201201
)?;
202202

203-
snapshot_memory_to_file(vmm, &params.mem_file_path, &params.snapshot_type)?;
203+
snapshot_memory_to_file(vmm, &params.mem_file_path, params.snapshot_type)?;
204204

205205
Ok(())
206206
}
@@ -234,7 +234,7 @@ fn snapshot_state_to_file(
234234
fn snapshot_memory_to_file(
235235
vmm: &Vmm,
236236
mem_file_path: &Path,
237-
snapshot_type: &SnapshotType,
237+
snapshot_type: SnapshotType,
238238
) -> Result<(), CreateSnapshotError> {
239239
use self::CreateSnapshotError::*;
240240
let mut file = OpenOptions::new()

src/vmm/src/vmm_config/snapshot.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize};
1111

1212
/// The snapshot type options that are available when
1313
/// creating a new snapshot.
14-
#[derive(Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
14+
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
1515
pub enum SnapshotType {
1616
/// Diff snapshot.
1717
Diff,

0 commit comments

Comments
 (0)