fix: use write_all in serialize method for FS Info sector

This commit is contained in:
Rafał Harabień 2018-12-08 23:45:31 +01:00
parent 70b0a771b8
commit 96339ff7e6

View File

@ -155,12 +155,12 @@ impl FsInfoSector {
fn serialize<T: Write>(&self, wrt: &mut T) -> io::Result<()> { fn serialize<T: Write>(&self, wrt: &mut T) -> io::Result<()> {
wrt.write_u32::<LittleEndian>(Self::LEAD_SIG)?; wrt.write_u32::<LittleEndian>(Self::LEAD_SIG)?;
let reserved = [0u8; 480]; let reserved = [0u8; 480];
wrt.write(&reserved)?; wrt.write_all(&reserved)?;
wrt.write_u32::<LittleEndian>(Self::STRUC_SIG)?; wrt.write_u32::<LittleEndian>(Self::STRUC_SIG)?;
wrt.write_u32::<LittleEndian>(self.free_cluster_count.unwrap_or(0xFFFFFFFF))?; wrt.write_u32::<LittleEndian>(self.free_cluster_count.unwrap_or(0xFFFFFFFF))?;
wrt.write_u32::<LittleEndian>(self.next_free_cluster.unwrap_or(0xFFFFFFFF))?; wrt.write_u32::<LittleEndian>(self.next_free_cluster.unwrap_or(0xFFFFFFFF))?;
let reserved2 = [0u8; 12]; let reserved2 = [0u8; 12];
wrt.write(&reserved2)?; wrt.write_all(&reserved2)?;
wrt.write_u32::<LittleEndian>(Self::TRAIL_SIG)?; wrt.write_u32::<LittleEndian>(Self::TRAIL_SIG)?;
Ok(()) Ok(())
} }