Mask a secret input value for display (truncate with `...` if long).
(value: &str)
| 415 | |
| 416 | /// Mask a secret input value for display (truncate with `...` if long). |
| 417 | fn mask_input_value(value: &str) -> String { |
| 418 | let len = value.len(); |
| 419 | if len <= 20 { |
| 420 | "*".repeat(len) |
| 421 | } else { |
| 422 | format!("{}...", "*".repeat(17)) |
| 423 | } |
| 424 | } |
| 425 | |
| 426 | // --------------------------------------------------------------------------- |
| 427 | // Phase 4: Creating (pacman animation + result) |