From 1097d7d5e930cbdecb3a8360b0083407a79ad2da Mon Sep 17 00:00:00 2001 From: Devon Sawatsky Date: Sat, 21 Oct 2023 23:39:09 -0700 Subject: fix spelling & minor changes --- gifed/src/lzw.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gifed/src/lzw.rs b/gifed/src/lzw.rs index cd3fcd5..f787fdd 100644 --- a/gifed/src/lzw.rs +++ b/gifed/src/lzw.rs @@ -2,13 +2,13 @@ use std::collections::HashMap; pub struct LZW {} impl LZW { - pub fn encode(minimum_size: u8, indicies: &[u8]) -> Vec { + pub fn encode(minimum_size: u8, indices: &[u8]) -> Vec { let mut dictionary: HashMap, u16> = HashMap::new(); let cc = 1 << minimum_size; let eoi = cc + 1; - println!("mcs {} | cc {}", minimum_size, cc); + println!("mcs {minimum_size} | cc {cc}"); // Fill dictionary with self-descriptive values for value in 0..cc { @@ -18,14 +18,14 @@ impl LZW { let mut next_code = eoi + 1; let mut code_size = minimum_size + 1; - let mut iter = indicies.iter(); + let mut iter = indices.iter(); let mut out = BitStream::new(); let mut buffer = vec![*iter.next().unwrap()]; out.push_bits(code_size, cc); - for &indicie in iter { - buffer.push(indicie); + for &index in iter { + buffer.push(index); if !dictionary.contains_key(&buffer) { buffer.pop(); -- cgit 1.4.1-3-g733a5