REMOVED: unused imports

ADDED: header (shitty)
This commit is contained in:
doryan 2024-02-08 12:58:01 +04:00
parent 55b2c4ec56
commit 703292a799
3 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,3 @@
use std::ops::Deref;
use bitvec::prelude::{AsBits};
use crate::model::processing_input::processing_input;
use crate::model::check_correct_input::check_correct_input;
use crate::model::from_string_to_vec_bits::from_string_to_vec_bits;

View File

@ -7,7 +7,6 @@
// ошибочная позиция 7 false false false
pub mod hamming_code{
use std::borrow::Borrow;
use std::collections::HashMap;
pub fn hamming_encrypt_data(data: &Vec<u8>, result_string: &mut String, length_of_code: usize) -> () {
@ -68,7 +67,7 @@ pub mod hamming_code{
let error_position = syndromes
.iter()
.find(move |&(&error_position, &error)| error == checked_bits).
.find(move |&(&index, &error)| error == checked_bits).
unwrap().0;
let correctly_code : Vec<u8> = data_bits

View File

@ -15,6 +15,11 @@ fn clearing(output : &TextView, input: &TextView){
pub fn laboratory_work_first_section(wrapper: &Box) -> (){
let header = Label::builder()
.halign(Align::Start)
.label("Лабораторная работа №8: Код Хэмминга")
.build();
// input
let hamming_text_view_input_label = Label::builder()
@ -120,6 +125,7 @@ pub fn laboratory_work_first_section(wrapper: &Box) -> (){
interactive_components_wrapper.append(&crypt_mode_wrapper);
interactive_components_wrapper.append(&hamming_crypt_button);
wrapper.append(&header);
wrapper.append(&hamming_text_view_input_label);
wrapper.append(&hamming_text_view_input_frame);
wrapper.append(&interactive_components_wrapper);