From c495465a8cf703b463b16cb4dd914003f2c36479 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 25 Nov 2024 20:33:02 +0100 Subject: [PATCH] changes --- src/cpu.rs | 4 ++-- src/file.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cpu.rs b/src/cpu.rs index a13286c..6366104 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -29,8 +29,8 @@ impl CPU for ExampleCPU { registers: [0; 4], }; - let len = initial_state.len(); - let ram_len = instance.ram.len(); + let len: usize = initial_state.len(); + let ram_len: usize = instance.ram.len(); if len >= ram_len { instance.ram.copy_from_slice(&initial_state[..ram_len]); diff --git a/src/file.rs b/src/file.rs index 33d7168..68a8759 100644 --- a/src/file.rs +++ b/src/file.rs @@ -17,8 +17,8 @@ pub fn save_binary_u8(file_path: &str, content: Vec) { } pub fn load_binary_u8(file_path: &str) -> Vec { - let mut file = File::open(file_path).unwrap(); - let mut buffer = Vec::new(); + let mut file: File = File::open(file_path).unwrap(); + let mut buffer: Vec = Vec::new(); file.read_to_end(&mut buffer).unwrap(); buffer }