changes
This commit is contained in:
parent
51f7d7214a
commit
c495465a8c
2 changed files with 4 additions and 4 deletions
|
@ -29,8 +29,8 @@ impl CPU<u8> for ExampleCPU {
|
||||||
registers: [0; 4],
|
registers: [0; 4],
|
||||||
};
|
};
|
||||||
|
|
||||||
let len = initial_state.len();
|
let len: usize = initial_state.len();
|
||||||
let ram_len = instance.ram.len();
|
let ram_len: usize = instance.ram.len();
|
||||||
|
|
||||||
if len >= ram_len {
|
if len >= ram_len {
|
||||||
instance.ram.copy_from_slice(&initial_state[..ram_len]);
|
instance.ram.copy_from_slice(&initial_state[..ram_len]);
|
||||||
|
|
|
@ -17,8 +17,8 @@ pub fn save_binary_u8(file_path: &str, content: Vec<u8>) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn load_binary_u8(file_path: &str) -> Vec<u8> {
|
pub fn load_binary_u8(file_path: &str) -> Vec<u8> {
|
||||||
let mut file = File::open(file_path).unwrap();
|
let mut file: File = File::open(file_path).unwrap();
|
||||||
let mut buffer = Vec::new();
|
let mut buffer: Vec<u8> = Vec::new();
|
||||||
file.read_to_end(&mut buffer).unwrap();
|
file.read_to_end(&mut buffer).unwrap();
|
||||||
buffer
|
buffer
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue