Skip to content

Commit 28f11cc

Browse files
authored
typo
protocolL -> protocol
1 parent 1c0897d commit 28f11cc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

chapter-three/src/bin/binary_files.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn write_dummy_protocol(path: &str) -> io::Result<()> {
2222
let mut buf_writer = BufWriter::new(file);
2323

2424
// Let's say our binary file starts with a magic number
25-
// to show readers that this is our protocoll
25+
// to show readers that this is our protocol
2626
let magic = b"MyProtocol";
2727
buf_writer.write_all(magic)?;
2828

@@ -58,8 +58,8 @@ fn read_protocol(path: &str) -> io::Result<Vec<u32>> {
5858
let mut endian = [0u8; 2];
5959
buf_reader.read_exact(&mut endian)?;
6060
match &endian {
61-
b"LE" => read_protocoll_payload::<LE, _>(&mut buf_reader),
62-
b"BE" => read_protocoll_payload::<BE, _>(&mut buf_reader),
61+
b"LE" => read_protocol_payload::<LE, _>(&mut buf_reader),
62+
b"BE" => read_protocol_payload::<BE, _>(&mut buf_reader),
6363
_ => Err(io::Error::new(
6464
io::ErrorKind::Other,
6565
"Failed to parse endianness",
@@ -68,7 +68,7 @@ fn read_protocol(path: &str) -> io::Result<Vec<u32>> {
6868
}
6969

7070
// Read as much of the payload as possible
71-
fn read_protocoll_payload<E, R>(reader: &mut R) -> io::Result<Vec<u32>>
71+
fn read_protocol_payload<E, R>(reader: &mut R) -> io::Result<Vec<u32>>
7272
where
7373
E: ByteOrder,
7474
R: ReadBytesExt,

0 commit comments

Comments
 (0)