Fixed more clippy complaining

This commit is contained in:
François Autin 2023-03-10 11:03:54 +01:00
parent be8435cf83
commit 6ee74ba126
No known key found for this signature in database
GPG Key ID: 343F5D382E1DD77C
2 changed files with 4 additions and 18 deletions

View File

@ -15,7 +15,7 @@ use std::io::BufRead;
///
/// - **path** the path of the file to load
/// - **size** the number of bytes to write (1, 2, 4 or 8)
pub fn load(path : &str, instruction_size: i32) -> Machine {
pub fn _load(path : &str, instruction_size: i32) -> Machine {
let file = fs::File::open(path).expect("Wrong filename");
let reader = io::BufReader::new(file);
let mut machine = Machine::_init_machine();

View File

@ -55,7 +55,6 @@ impl Section{
let len: usize = string_hex_to_usize(&section.len);
let mut tmp_a: char = ' ';
let mut tmp_b: char = ' ';
for (i, c) in section.content.chars().enumerate(){
@ -63,8 +62,7 @@ impl Section{
tmp_a = c;
}
else {
tmp_b = c;
content.push(two_hex_to_u8(tmp_a,tmp_b));
content.push(two_hex_to_u8(tmp_a,c));
}
}
@ -150,7 +148,7 @@ impl MemChecker{
let section_f = SectionFormat{
addr: tmp_addr_str.clone(),
len: tmp_len_str.clone(),
content: current_line.clone().replace(" ", ""),
content: current_line.clone().replace(' ', ""),
};
sections.push(Section::from(&section_f));
}
@ -172,7 +170,7 @@ impl MemChecker{
for(i,s) in m_c.sections.iter().enumerate() {
println!("\nSection {}\n", i);
Section::print_section(&s);
Section::print_section(s);
}
}
@ -374,18 +372,6 @@ mod tests {
assert_eq!(section.content, expected_vec);
}
#[test]
fn test_mod(){
let cond = (0%2) == 0;
assert!(cond);
}
#[test]
fn test_mod_2(){
let cond = (1%2) == 1;
assert!(cond);
}
#[test]
fn test_hex_1(){
let b = two_hex_to_u8('0', '0');