Parse a key string of the form "{tid}:{collection}:{field}" into a tuple. Returns `None` if the string doesn't have at least two ':' separators.
(key: &str)
| 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. |
| 197 | fn parse_spatial_key(key: &str) -> Option<(crate::types::TenantId, String, String)> { |
| 198 | let mut parts = key.splitn(3, ':'); |
| 199 | let tid_str = parts.next()?; |
| 200 | let coll = parts.next()?.to_string(); |
| 201 | let field = parts.next().unwrap_or("").to_string(); |
| 202 | let tid_u64: u64 = tid_str.parse().ok()?; |
| 203 | Some((crate::types::TenantId::new(tid_u64), coll, field)) |
| 204 | } |
no test coverage detected