mirror of
https://github.com/kata-containers/cgroups-rs.git
synced 2026-08-05 02:13:23 +00:00
Use Option as resource fields, remove the update switch: update_values
Use idiomatic Option::None to represent optional fields. This enables updates where not all fields need to be specified. Signed-off-by: Tim Zhang <tim@hyper.sh>
This commit is contained in:
+2
-4
@@ -48,10 +48,8 @@ impl ControllerInternal for NetPrioController {
|
||||
// get the resources that apply to this controller
|
||||
let res: &NetworkResources = &res.network;
|
||||
|
||||
if res.update_values {
|
||||
for i in &res.priorities {
|
||||
let _ = self.set_if_prio(&i.name, i.priority);
|
||||
}
|
||||
for i in &res.priorities {
|
||||
let _ = self.set_if_prio(&i.name, i.priority);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user