(text: &str, abs_start: usize, token_end: usize, token: &str)
| 513 | } |
| 514 | |
| 515 | fn token_boundary_ok(text: &str, abs_start: usize, token_end: usize, token: &str) -> bool { |
| 516 | if token.starts_with(PLACEHOLDER_PREFIX) { |
| 517 | return token_end == text.len() |
| 518 | || !is_env_key_char(text.as_bytes()[token_end]) |
| 519 | || text[token_end..].starts_with(PLACEHOLDER_PREFIX); |
| 520 | } |
| 521 | let before_ok = abs_start == 0 || !is_alias_token_char(text.as_bytes()[abs_start - 1]); |
| 522 | let after_ok = token_end == text.len() || !is_alias_token_char(text.as_bytes()[token_end]); |
| 523 | before_ok && after_ok |
| 524 | } |
| 525 | |
| 526 | pub fn placeholder_for_env_key(key: &str) -> String { |
| 527 | format!("{PLACEHOLDER_PREFIX}{key}") |
no test coverage detected