X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=src%2Fio%2Fintcode.rs;h=8d879205762a0c50ba8a1dc6756821ab2aa0befe;hb=b74ff9fac35d41737d71d97227fad233aa4a4b49;hp=e876772df8d320e4ffe539d2278b4d9ea3c13a53;hpb=6036ce2832c9b06794569a514b2dda92c2ebe056;p=nihav.git diff --git a/src/io/intcode.rs b/src/io/intcode.rs index e876772..8d87920 100644 --- a/src/io/intcode.rs +++ b/src/io/intcode.rs @@ -1,4 +1,4 @@ -use io::bitreader::{BitReader, BitReaderError, BitReaderResult}; +use crate::io::bitreader::{BitReader, BitReaderError, BitReaderResult}; #[derive(Debug)] pub enum UintCodeType { @@ -33,7 +33,7 @@ fn read_unary(br: &mut BitReader, terminator: u32) -> BitReaderResult { } } -fn read_unary_lim(br: &mut BitReader, terminator: u32, len: u32) -> BitReaderResult { +fn read_unary_lim(br: &mut BitReader, len: u32, terminator: u32) -> BitReaderResult { let mut res: u32 = 0; loop { if br.read(1)? == terminator { return Ok(res); } @@ -101,7 +101,7 @@ impl<'a> IntCodeReader for BitReader<'a> { match t { UintCodeType::UnaryOnes => read_unary(self, 0), UintCodeType::UnaryZeroes => read_unary(self, 1), - UintCodeType::LimitedUnary(len, term) => read_unary_lim(self, term, len), + UintCodeType::LimitedUnary(len, term) => read_unary_lim(self, len, term), UintCodeType::Unary012 => read_unary_lim(self, 2, 0), UintCodeType::Unary210 => read_unary210(self), UintCodeType::Golomb(m) => read_golomb(self, m), @@ -131,7 +131,7 @@ impl<'a> IntCodeReader for BitReader<'a> { #[cfg(test)] mod test { use super::*; - use io::bitreader::*; + use crate::io::bitreader::*; #[test] fn int_codes() {