Extract the default identity ID from config.toml content. Looks for `default_identity = "BASE32_ID"` in the TOML.
(content: &str)
| 373 | /// |
| 374 | /// Looks for `default_identity = "BASE32_ID"` in the TOML. |
| 375 | fn extract_default_identity_from_config(content: &str) -> Option<String> { |
| 376 | // Simple TOML parsing — look for default_identity key |
| 377 | for line in content.lines() { |
| 378 | let trimmed = line.trim(); |
| 379 | if trimmed.starts_with("default_identity") { |
| 380 | // Extract the value between quotes |
| 381 | if let Some(start) = trimmed.find('"') { |
| 382 | if let Some(end) = trimmed.rfind('"') { |
| 383 | if end > start { |
| 384 | let value = &trimmed[start + 1..end]; |
| 385 | if !value.is_empty() { |
| 386 | return Some(value.to_string()); |
| 387 | } |
| 388 | } |
| 389 | } |
| 390 | } |
| 391 | } |
| 392 | } |
| 393 | None |
| 394 | } |
| 395 | |
| 396 | /// Load identity info from a directory matching the given ID. |
| 397 | fn load_identity_by_id(identities_dir: &Path, id_base32: &str) -> Option<UserIdentityInfo> { |
no test coverage detected