Extract the default identity ID from config.toml content. Looks for `default_identity = "BASE32_ID"` in the TOML.
(content: &str)
| 262 | /// |
| 263 | /// Looks for `default_identity = "BASE32_ID"` in the TOML. |
| 264 | fn extract_default_identity_from_config(content: &str) -> Option<String> { |
| 265 | // Simple TOML parsing — look for default_identity key |
| 266 | for line in content.lines() { |
| 267 | let trimmed = line.trim(); |
| 268 | if trimmed.starts_with("default_identity") { |
| 269 | // Extract the value between quotes |
| 270 | if let Some(start) = trimmed.find('"') { |
| 271 | if let Some(end) = trimmed.rfind('"') { |
| 272 | if end > start { |
| 273 | let value = &trimmed[start + 1..end]; |
| 274 | if !value.is_empty() { |
| 275 | return Some(value.to_string()); |
| 276 | } |
| 277 | } |
| 278 | } |
| 279 | } |
| 280 | } |
| 281 | } |
| 282 | None |
| 283 | } |
| 284 | |
| 285 | /// Load identity info from a directory matching the given ID. |
| 286 | fn load_identity_by_id(identities_dir: &Path, id_base32: &str) -> Option<UserIdentityInfo> { |
no test coverage detected