FIXED: clearing inputs bug
This commit is contained in:
parent
a58110a3f8
commit
37a8dfb66b
|
@ -8,4 +8,3 @@ pub fn state_controller(switch: &Switch, label: &Label) -> () {
|
||||||
label.set_label("Режим: кодирование");
|
label.set_label("Режим: кодирование");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,10 @@ pub fn processing_input(input: &String) -> String {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn check_correct_input(input: &String, prepared_input: &String, l: usize) -> (bool, bool) {
|
pub fn check_correct_input(input: &String, prepared_input: &String, l: usize) -> (bool, bool) {
|
||||||
let first_condition = input.chars().all(|c| c == '1' || c == '0' || c == ' ');
|
let first_condition = input
|
||||||
|
.as_str()
|
||||||
|
.chars()
|
||||||
|
.all(|c| c == '1' || c == '0' || c == ' ');
|
||||||
|
|
||||||
let second_condition = prepared_input.len() % l == 0;
|
let second_condition = prepared_input.len() % l == 0;
|
||||||
|
|
||||||
|
|
|
@ -81,4 +81,3 @@ impl InputBuilder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ pub fn hamming_code_page(wrapper: &Box) -> () {
|
||||||
let text_view_output_for_output = hamming_text_view_output.clone();
|
let text_view_output_for_output = hamming_text_view_output.clone();
|
||||||
|
|
||||||
let text_view_input_for_clearing = hamming_text_view_input.clone();
|
let text_view_input_for_clearing = hamming_text_view_input.clone();
|
||||||
let text_view_output_for_clearing = hamming_text_view_input.clone();
|
let text_view_output_for_clearing = hamming_text_view_output.clone();
|
||||||
|
|
||||||
// actions
|
// actions
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue