Fixed more clippy complaining
This commit is contained in:
parent
be8435cf83
commit
6ee74ba126
@ -15,7 +15,7 @@ use std::io::BufRead;
|
|||||||
///
|
///
|
||||||
/// - **path** the path of the file to load
|
/// - **path** the path of the file to load
|
||||||
/// - **size** the number of bytes to write (1, 2, 4 or 8)
|
/// - **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 file = fs::File::open(path).expect("Wrong filename");
|
||||||
let reader = io::BufReader::new(file);
|
let reader = io::BufReader::new(file);
|
||||||
let mut machine = Machine::_init_machine();
|
let mut machine = Machine::_init_machine();
|
||||||
|
@ -55,7 +55,6 @@ impl Section{
|
|||||||
let len: usize = string_hex_to_usize(§ion.len);
|
let len: usize = string_hex_to_usize(§ion.len);
|
||||||
|
|
||||||
let mut tmp_a: char = ' ';
|
let mut tmp_a: char = ' ';
|
||||||
let mut tmp_b: char = ' ';
|
|
||||||
|
|
||||||
for (i, c) in section.content.chars().enumerate(){
|
for (i, c) in section.content.chars().enumerate(){
|
||||||
|
|
||||||
@ -63,8 +62,7 @@ impl Section{
|
|||||||
tmp_a = c;
|
tmp_a = c;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
tmp_b = c;
|
content.push(two_hex_to_u8(tmp_a,c));
|
||||||
content.push(two_hex_to_u8(tmp_a,tmp_b));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,7 +148,7 @@ impl MemChecker{
|
|||||||
let section_f = SectionFormat{
|
let section_f = SectionFormat{
|
||||||
addr: tmp_addr_str.clone(),
|
addr: tmp_addr_str.clone(),
|
||||||
len: tmp_len_str.clone(),
|
len: tmp_len_str.clone(),
|
||||||
content: current_line.clone().replace(" ", ""),
|
content: current_line.clone().replace(' ', ""),
|
||||||
};
|
};
|
||||||
sections.push(Section::from(§ion_f));
|
sections.push(Section::from(§ion_f));
|
||||||
}
|
}
|
||||||
@ -172,7 +170,7 @@ impl MemChecker{
|
|||||||
|
|
||||||
for(i,s) in m_c.sections.iter().enumerate() {
|
for(i,s) in m_c.sections.iter().enumerate() {
|
||||||
println!("\nSection {}\n", i);
|
println!("\nSection {}\n", i);
|
||||||
Section::print_section(&s);
|
Section::print_section(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -374,18 +372,6 @@ mod tests {
|
|||||||
assert_eq!(section.content, expected_vec);
|
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]
|
#[test]
|
||||||
fn test_hex_1(){
|
fn test_hex_1(){
|
||||||
let b = two_hex_to_u8('0', '0');
|
let b = two_hex_to_u8('0', '0');
|
||||||
|
Loading…
Reference in New Issue
Block a user