From 834d1a7b41827dee26c5d09dc455314e61a7dc5c Mon Sep 17 00:00:00 2001 From: Furisto <24721048+Furisto@users.noreply.github.com> Date: Tue, 17 Aug 2021 22:08:41 +0200 Subject: [PATCH] Remove A device type --- src/runtime/linux.rs | 11 +++-------- src/runtime/test.rs | 8 ++++---- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/runtime/linux.rs b/src/runtime/linux.rs index fa76e4edb7..7cf6ee1a7a 100644 --- a/src/runtime/linux.rs +++ b/src/runtime/linux.rs @@ -157,14 +157,11 @@ pub enum LinuxDeviceType { /// FIFO P, - - /// ?? - A, } impl Default for LinuxDeviceType { fn default() -> LinuxDeviceType { - LinuxDeviceType::A + LinuxDeviceType::B } } @@ -175,7 +172,6 @@ impl LinuxDeviceType { Self::C => "c", Self::U => "u", Self::P => "p", - Self::A => "a", } } } @@ -917,7 +913,7 @@ fn some_none_generator_util(g: &mut Gen) -> Option { #[cfg(feature = "proptests")] impl Arbitrary for LinuxDeviceCgroup { fn arbitrary(g: &mut Gen) -> LinuxDeviceCgroup { - let typ_choices = ["b", "c", "u", "p", "a"]; + let typ_choices = ["b", "c", "u", "p"]; let typ_chosen = g.choose(&typ_choices).unwrap(); @@ -926,8 +922,7 @@ impl Arbitrary for LinuxDeviceCgroup { "c" => LinuxDeviceType::C, "u" => LinuxDeviceType::U, "p" => LinuxDeviceType::P, - "a" => LinuxDeviceType::A, - _ => LinuxDeviceType::A, + _ => LinuxDeviceType::B, }; let access_choices = ["rwm", "m"]; diff --git a/src/runtime/test.rs b/src/runtime/test.rs index d717b7a03f..bcc13ff6c6 100644 --- a/src/runtime/test.rs +++ b/src/runtime/test.rs @@ -13,18 +13,18 @@ fn serialize_and_deserialize_spec() { fn test_linux_device_cgroup_to_string() { let ldc = LinuxDeviceCgroup { allow: true, - typ: Some(LinuxDeviceType::A), + typ: Some(LinuxDeviceType::B), major: None, minor: None, access: Some("rwm".into()), }; - assert_eq!(ldc.to_string(), "a *:* rwm"); + assert_eq!(ldc.to_string(), "b *:* rwm"); let ldc = LinuxDeviceCgroup { allow: true, - typ: Some(LinuxDeviceType::A), + typ: Some(LinuxDeviceType::B), major: Some(1), minor: Some(9), access: Some("rwm".into()), }; - assert_eq!(ldc.to_string(), "a 1:9 rwm"); + assert_eq!(ldc.to_string(), "b 1:9 rwm"); }