switching from vec to slice

This commit is contained in:
Moysan Gabriel
2023-04-19 00:31:46 +02:00
parent d6ac7671dc
commit 153c3d6618
3 changed files with 22 additions and 16 deletions

View File

@ -18,7 +18,7 @@ impl DrvDisk {
/// - **self** driver disk
/// - **sector_number** sector where to read the data
/// - **data** where the readed data will be stored
pub fn read_sector(&mut self, sector_number: i32, data: &mut Vec<u8>) {
pub fn read_sector(&mut self, sector_number: i32, data: &mut [u8]) {
match Disk::read_request(&mut self.disk, sector_number, data) {
Err(e) => println!("{:?}", e),
_ => (),
@ -32,7 +32,7 @@ impl DrvDisk {
/// - **self** driver disk
/// - **sector_number** sector where to write the data
/// - **data** where the data to write is stored
pub fn write_sector(&mut self, sector_number: i32, data: &mut Vec<u8>) {
pub fn write_sector(&mut self, sector_number: i32, data: &[u8]) {
match Disk::write_request(&mut self.disk, sector_number, data) {
Err(e) => println!("{:?}", e),
_ => (),