Skip to content

Commit

Permalink
Clean up example comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tuffy committed Jun 14, 2024
1 parent 10a4a61 commit f5d9cca
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
34 changes: 17 additions & 17 deletions src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
//!
//! #[derive(Debug, PartialEq, Eq)]
//! struct BlockHeader {
//! last_block: bool,
//! block_type: u8,
//! block_size: u32,
//! last_block: bool, // 1 bit
//! block_type: u8, // 7 bits
//! block_size: u32, // 24 bits
//! }
//!
//! impl FromBitStream for BlockHeader {
Expand All @@ -61,15 +61,15 @@
//!
//! #[derive(Debug, PartialEq, Eq)]
//! struct Streaminfo {
//! minimum_block_size: u16,
//! maximum_block_size: u16,
//! minimum_frame_size: u32,
//! maximum_frame_size: u32,
//! sample_rate: u32,
//! channels: u8,
//! bits_per_sample: u8,
//! total_samples: u64,
//! md5: [u8; 16],
//! minimum_block_size: u16, // 16 bits
//! maximum_block_size: u16, // 16 bits
//! minimum_frame_size: u32, // 24 bits
//! maximum_frame_size: u32, // 24 bits
//! sample_rate: u32, // 20 bits
//! channels: u8, // 3 bits
//! bits_per_sample: u8, // 5 bits
//! total_samples: u64, // 36 bits
//! md5: [u8; 16], // 16 bytes
//! }
//!
//! impl FromBitStream for Streaminfo {
Expand All @@ -81,11 +81,11 @@
//! maximum_block_size: r.read_to()?,
//! minimum_frame_size: r.read_in::<24, _>()?,
//! maximum_frame_size: r.read_in::<24, _>()?,
//! sample_rate: r.read_in::<20, _>()?,
//! channels: r.read_in::<3, u8>()? + 1,
//! bits_per_sample: r.read_in::<5, u8>()? + 1,
//! total_samples: r.read_in::<36, _>()?,
//! md5: r.read_to()?,
//! sample_rate: r.read_in::<20, _>()?,
//! channels: r.read_in::<3, u8>()? + 1,
//! bits_per_sample: r.read_in::<5, u8>()? + 1,
//! total_samples: r.read_in::<36, _>()?,
//! md5: r.read_to()?,
//! })
//! }
//! }
Expand Down
28 changes: 14 additions & 14 deletions src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
//!
//! #[derive(Debug, PartialEq, Eq)]
//! struct BlockHeader {
//! last_block: bool,
//! block_type: u8,
//! block_size: u32,
//! last_block: bool, // 1 bit
//! block_type: u8, // 7 bits
//! block_size: u32, // 24 bits
//! }
//!
//! impl ToBitStream for BlockHeader {
Expand All @@ -38,15 +38,15 @@
//!
//! #[derive(Debug, PartialEq, Eq)]
//! struct Streaminfo {
//! minimum_block_size: u16,
//! maximum_block_size: u16,
//! minimum_frame_size: u32,
//! maximum_frame_size: u32,
//! sample_rate: u32,
//! channels: u8,
//! bits_per_sample: u8,
//! total_samples: u64,
//! md5: [u8; 16],
//! minimum_block_size: u16, // 16 bits
//! maximum_block_size: u16, // 16 bits
//! minimum_frame_size: u32, // 24 bits
//! maximum_frame_size: u32, // 24 bits
//! sample_rate: u32, // 20 bits
//! channels: u8, // 3 bits
//! bits_per_sample: u8, // 5 bits
//! total_samples: u64, // 36 bits
//! md5: [u8; 16], // 16 bytes
//! }
//!
//! impl ToBitStream for Streaminfo {
Expand All @@ -58,8 +58,8 @@
//! w.write_out::<24, _>(self.minimum_frame_size)?;
//! w.write_out::<24, _>(self.maximum_frame_size)?;
//! w.write_out::<20, _>(self.sample_rate)?;
//! w.write_out::<3, _>(self.channels - 1)?;
//! w.write_out::<5, _>(self.bits_per_sample - 1)?;
//! w.write_out::<3, _>(self.channels - 1)?;
//! w.write_out::<5, _>(self.bits_per_sample - 1)?;
//! w.write_out::<36, _>(self.total_samples)?;
//! w.write_bytes(&self.md5)
//! }
Expand Down

0 comments on commit f5d9cca

Please sign in to comment.