Returns the values of `&self` in vector representation. This is useful for values that may be available as both single values and arrays.
(&self)
| 99 | /// |
| 100 | /// This is useful for values that may be available as both single values and arrays. |
| 101 | pub fn as_vec(&self) -> Vec<&String> { |
| 102 | match self { |
| 103 | Value::Single(item) => vec![&item], |
| 104 | Value::Array(items) => Vec::from_iter(items.iter()), |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | /// Returns the values of `self` in vector representation. |
| 109 | /// |
no outgoing calls
no test coverage detected