Skip to content

[tr] fix: test test_tr_s #130

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions text/src/tr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ fn contains_single_range(s: &str) -> bool {
fn complement_chars(input: &str, chars1: Vec<Operand>, mut chars2: Vec<Operand>) -> String {
// Create a variable to store the result
let mut result = String::new();
let chars_2_const = chars2.clone();

// Initialize the index for the chars2 vector
let mut chars2_index = 0;
Expand Down Expand Up @@ -695,6 +696,7 @@ fn complement_chars(input: &str, chars1: Vec<Operand>, mut chars2: Vec<Operand>)
// If the index has reached the end of the chars2 vector, reset it to zero
if chars2_index >= chars2.len() {
chars2_index = 0;
chars2.clone_from(&chars_2_const);
}
}

Expand Down