Skip to content

Commit

Permalink
feat: remove debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
josecelano committed Oct 8, 2024
1 parent c235796 commit 8a9d395
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions src/parsers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ pub enum BencodeType {
}

pub struct BencodeParser<R: Read> {
pub debug: bool,
pub iter: u64,
byte_reader: ByteReader<R>,
iter: u64,
stack: Stack,
}

Expand All @@ -42,9 +41,8 @@ impl<R: Read> BencodeParser<R> {

pub fn new(reader: R) -> Self {
BencodeParser {
debug: false, // todo: use tracing crate
iter: 1,
byte_reader: ByteReader::new(reader),
iter: 1,
stack: Stack::default(),
}
}
Expand Down Expand Up @@ -109,12 +107,6 @@ impl<R: Read> BencodeParser<R> {
},
};

if self.debug {
println!("iter: {}", self.iter);
println!("pos: {}", self.byte_reader.input_byte_counter);
println!("byte: {} ({})", byte, byte as char);
}

match byte {
b'i' => {
self.begin_bencoded_value(&BencodeType::Integer, writer)?;
Expand Down Expand Up @@ -148,13 +140,6 @@ impl<R: Read> BencodeParser<R> {
}
}

if self.debug {
println!("stack: {}", self.stack);
self.byte_reader.print_captured_input();
writer.print_captured_output();
println!();
}

self.iter += 1;
}

Expand Down

0 comments on commit 8a9d395

Please sign in to comment.