refactor(import + some code): change import and refactor some bad blocks of code
This commit is contained in:
parent
fcfb0d1fa6
commit
dbf7dab513
|
@ -1,7 +1,7 @@
|
|||
use gtk4 as gtk;
|
||||
|
||||
use crate::controller::model_utils::signal_reducer::*;
|
||||
use crate::model::model::SchemeCharacteristics;
|
||||
use crate::model::models::SchemeCharacteristics;
|
||||
use gtk::{prelude::*, *};
|
||||
|
||||
pub fn check_characteristics(
|
||||
|
@ -24,7 +24,7 @@ pub fn check_characteristics(
|
|||
println!("{:?}", int);
|
||||
}
|
||||
Err(err) => {
|
||||
if output.len() == 0 {
|
||||
if output.is_empty() {
|
||||
output.push_str("Введите пожалуйста числа в полях");
|
||||
println!("{:?}", err);
|
||||
}
|
||||
|
@ -32,11 +32,7 @@ pub fn check_characteristics(
|
|||
}
|
||||
}
|
||||
|
||||
if output.len() != 0 {
|
||||
false
|
||||
} else {
|
||||
true
|
||||
}
|
||||
!output.is_empty()
|
||||
}
|
||||
|
||||
pub fn start_algorithm(
|
||||
|
@ -48,7 +44,7 @@ pub fn start_algorithm(
|
|||
let mut all_inputs_data: Vec<f64> = Vec::new();
|
||||
let mut output: String = String::new();
|
||||
|
||||
if let false = check_characteristics(raw_characteristics, &mut all_inputs_data, &mut output) {
|
||||
if !check_characteristics(raw_characteristics, &mut all_inputs_data, &mut output) {
|
||||
error_log_label.set_text(output.as_str());
|
||||
} else {
|
||||
error_log_label.set_text("");
|
||||
|
|
Loading…
Reference in New Issue