(s: &prost_types::Struct, section: &str, key: &str)
| 1630 | resources: &Option<prost_types::Struct>, |
| 1631 | ) -> Option<DriverResourceRequirements> { |
| 1632 | fn get_quantity(s: &prost_types::Struct, section: &str, key: &str) -> String { |
| 1633 | s.fields |
| 1634 | .get(section) |
| 1635 | .and_then(|v| match v.kind.as_ref() { |
| 1636 | Some(prost_types::value::Kind::StructValue(inner)) => inner.fields.get(key), |
| 1637 | _ => None, |
| 1638 | }) |
| 1639 | .and_then(|v| match v.kind.as_ref() { |
| 1640 | Some(prost_types::value::Kind::StringValue(val)) => Some(val.clone()), |
| 1641 | _ => None, |
| 1642 | }) |
| 1643 | .unwrap_or_default() |
| 1644 | } |
| 1645 | |
| 1646 | let s = resources.as_ref()?; |
| 1647 |
no test coverage detected