Reverse sanitize: restore ':' separators (best-effort). Keys are "{tid}:{collection}:{field}" → sanitized as "{tid}_{collection}_{field}". Only the first two `_` are replaced since `tid` is numeric (no underscores).
(sanitized: &str)
| 182 | /// Keys are "{tid}:{collection}:{field}" → sanitized as "{tid}_{collection}_{field}". |
| 183 | /// Only the first two `_` are replaced since `tid` is numeric (no underscores). |
| 184 | fn unsanitize_key(sanitized: &str) -> String { |
| 185 | let mut result = sanitized.to_string(); |
| 186 | if let Some(pos) = result.find('_') { |
| 187 | result.replace_range(pos..pos + 1, ":"); |
| 188 | if let Some(pos2) = result[pos + 1..].find('_') { |
| 189 | result.replace_range(pos + 1 + pos2..pos + 1 + pos2 + 1, ":"); |
| 190 | } |
| 191 | } |
| 192 | result |
| 193 | } |
| 194 | |
| 195 | /// Parse a key string of the form "{tid}:{collection}:{field}" into a tuple. |
| 196 | /// Returns `None` if the string doesn't have at least two ':' separators. |
no test coverage detected