An empty pattern list means unrestricted, which is worth saying explicitly rather than rendering as a blank the reader has to interpret.
(items: &[String])
| 146 | /// An empty pattern list means unrestricted, which is worth saying explicitly |
| 147 | /// rather than rendering as a blank the reader has to interpret. |
| 148 | fn or_all(items: &[String]) -> String { |
| 149 | if items.is_empty() { |
| 150 | "(all)".to_string() |
| 151 | } else { |
| 152 | items.join(", ") |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | #[cfg(test)] |
| 157 | mod tests { |