weekend work

This commit is contained in:
2024-11-04 10:38:46 -05:00
parent 5663123f81
commit 434cf92414
29 changed files with 564 additions and 654 deletions
+3 -7
View File
@@ -1,7 +1,7 @@
use clap::{Arg, Command};
use std::fs::File;
use std::io;
use std::io::{BufReader, Read};
use clap::{Arg, Command};
#[derive(Debug)]
struct CliArgs {
@@ -19,7 +19,6 @@ fn main() {
.required(true)
.index(1),
)
.get_matches();
// Parse the command-line arguments
@@ -53,12 +52,12 @@ fn read_file_to_bools(file_path: &str) -> io::Result<Vec<u8>> {
let bit = match byte {
b'1' => true,
b'0' => false,
_ => continue, // Skip non-'1' or '0' characters
_ => continue, // Skip non-'1' or '0' characters
};
// Set the appropriate bit in the current byte
if bit {
current_byte |= 1 << (7 - bit_index); // Set the bit at the correct position
current_byte |= 1 << (7 - bit_index); // Set the bit at the correct position
}
bit_index += 1;
@@ -76,8 +75,5 @@ fn read_file_to_bools(file_path: &str) -> io::Result<Vec<u8>> {
output.push(current_byte);
}
Ok(output)
}