MCPcopy Create free account
hub / github.com/archlinux/alpm / as_vec

Method as_vec

alpm-pkgbuild/src/bridge/parser.rs:101–106  ·  view source on GitHub ↗

Returns the values of `&self` in vector representation. This is useful for values that may be available as both single values and arrays.

(&self)

Source from the content-addressed store, hash-verified

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 ///

Callers 2

parse_value_arrayFunction · 0.80
parse_arch_arrayFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected