Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jr1221 committed May 19, 2024
1 parent 999110a commit e22d3cf
Showing 1 changed file with 1 addition and 36 deletions.
37 changes: 1 addition & 36 deletions cangen/RustSynth.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,41 +185,6 @@ class RustSnippets:
"#![allow(clippy::all)]\n" # Ignoring clippy for decode_data because it's autogenerated and has some unnecessary type casting to ensure correct types
)

# bitreader_impl: str = ("""
# /* Struct to decode a byte array bit by bit, sequentially */
# struct BitReader<'a> {
# data: &'a [u8],
# byte_pos: usize,
# bit_pos: u8,
# }

# impl<'a> BitReader<'a> {
# fn new(data: &'a [u8]) -> Self {
# Self {
# data,
# byte_pos: 0,
# bit_pos: 0,
# }
# }

# fn read_bits(&mut self, num_bits: u8) -> u32 {
# let mut value: u32 = 0;
# for _ in 0..num_bits {
# let bit = (self.data[self.byte_pos] >> (7 - self.bit_pos)) & 1;
# value = (value << 1) | bit as u32;

# self.bit_pos += 1;
# if self.bit_pos == 8 {
# self.bit_pos = 0;
# self.byte_pos += 1;
# }
# }
# value
# }
# }
# """
# )

format_impl = """
/**
* Class to contain the data formatting functions
Expand Down Expand Up @@ -251,7 +216,7 @@ class RustSnippets:
"""use super::data::Data;
use std::io::Cursor;
use bitstream_io::{BigEndian, LittleEndian, BitReader, BitRead};\n
""" # Importing the Data struct and the FormatData and ProcessData traits
""" # Importing the Data struct and the bistream io libraries
)

decode_return_type: str = "Vec::<Data>" # The return type of any decode function
Expand Down

0 comments on commit e22d3cf

Please sign in to comment.