runtime-rs: update LinuxCgroup type

Update translation code to match CCv0 changes

Co-authored-by: stevenhorsman <steven@uk.ibm.com>
Signed-off-by: Georgina Kinge <georgina.kinge@ibm.com>
This commit is contained in:
Georgina Kinge 2022-08-17 15:38:36 +01:00
parent bb9bbc7523
commit acb7a16522
2 changed files with 4 additions and 2 deletions

View File

@ -7,5 +7,7 @@ src/empty.rs
src/health.rs
src/health_ttrpc.rs
src/health_ttrpc_async.rs
src/image.rs
src/image_ttrpc.rs
src/oci.rs
src/types.rs

View File

@ -105,7 +105,7 @@ impl From<oci::LinuxDeviceCgroup> for crate::oci::LinuxDeviceCgroup {
fn from(from: oci::LinuxDeviceCgroup) -> Self {
crate::oci::LinuxDeviceCgroup {
Allow: from.allow,
Type: from.r#type,
Type: from.r#type.map_or("".to_string(), |t| t as String),
Major: from.major.map_or(0, |t| t as i64),
Minor: from.minor.map_or(0, |t| t as i64),
Access: from.access,
@ -478,7 +478,7 @@ impl From<crate::oci::LinuxDeviceCgroup> for oci::LinuxDeviceCgroup {
oci::LinuxDeviceCgroup {
allow: from.get_Allow(),
r#type: from.take_Type(),
r#type: Some(from.take_Type()),
major,
minor,
access: from.take_Access(),