mirror of
https://github.com/openai/codex.git
synced 2026-05-04 19:36:45 +00:00
[codex] Remove unused Rust helpers (#17146)
## Summary Removes high-confidence unused Rust helper functions and exports across `codex-tui`, `codex-shell-command`, and utility crates. The cleanup includes dead TUI helper methods, unused path/string/elapsed/fuzzy-match utilities, an unused Windows PowerShell lookup helper, and the unused terminal palette version counter. This keeps the remaining public surface smaller without changing behavior. ## Validation - `just fmt` - `cargo test -p codex-tui -p codex-shell-command -p codex-utils-elapsed -p codex-utils-fuzzy-match -p codex-utils-string -p codex-utils-path` - `just fix -p codex-tui -p codex-shell-command -p codex-utils-elapsed -p codex-utils-fuzzy-match -p codex-utils-string -p codex-utils-path` - `git diff --check`
This commit is contained in:
@@ -23,28 +23,6 @@ pub fn take_bytes_at_char_boundary(s: &str, maxb: usize) -> &str {
|
||||
&s[..last_ok]
|
||||
}
|
||||
|
||||
// Take a suffix of a &str within a byte budget at a char boundary
|
||||
#[inline]
|
||||
pub fn take_last_bytes_at_char_boundary(s: &str, maxb: usize) -> &str {
|
||||
if s.len() <= maxb {
|
||||
return s;
|
||||
}
|
||||
let mut start = s.len();
|
||||
let mut used = 0usize;
|
||||
for (i, ch) in s.char_indices().rev() {
|
||||
let nb = ch.len_utf8();
|
||||
if used + nb > maxb {
|
||||
break;
|
||||
}
|
||||
start = i;
|
||||
used += nb;
|
||||
if start == 0 {
|
||||
break;
|
||||
}
|
||||
}
|
||||
&s[start..]
|
||||
}
|
||||
|
||||
/// Sanitize a tag value to comply with metric tag validation rules:
|
||||
/// only ASCII alphanumeric, '.', '_', '-', and '/' are allowed.
|
||||
pub fn sanitize_metric_tag_value(value: &str) -> String {
|
||||
|
||||
Reference in New Issue
Block a user