<commit_before>use std::io::Write;
use std::io::Read;
use std::net::TcpListener;
use std::thread;

extern crate xdr;

fn main() {
	let listener = TcpListener::bind("127.0.0.1:9123").unwrap();
	println!("listening started, ready to accept");
	for stream in listener.incoming() {
		thread::spawn(|| {
				let mut stream = stream.unwrap();
				let mut data = [0u8;36];
				let _ = stream.read(&mut data);

				let mut strs : Vec<String>= data.iter().map(|b| format!("{:02X}", b)).collect();
				println!("{}",strs.connect(" "));
				let mut rdr = xdr::xdr::XdrReader::from_array(&data);

				let d_u8 : u8 = rdr.unpack().unwrap();
				let d_i8 : i8 = rdr.unpack().unwrap();
				let d_u16 : u16 = rdr.unpack().unwrap();
				let d_i16 : i16 = rdr.unpack().unwrap();
				let d_u32 : u32 = rdr.unpack().unwrap();
				let d_i32 : i32 = rdr.unpack().unwrap();
				let d_f32 : f32 = rdr.unpack().unwrap();
				let d_f64 : f64 = rdr.unpack().unwrap();

				let mut wr = xdr::xdr::XdrWriter::new();

				wr.pack(d_u8);
				wr.pack(d_i8);
				wr.pack(d_u16);
				wr.pack(d_i16);
				wr.pack(d_u32);
				wr.pack(d_i32);
				wr.pack(d_f32);
				wr.pack(d_f64);

				let buf = wr.into_buffer();
				strs = buf.iter().map(|b| format!("{:02X}", b)).collect();
				println!("{}",strs.connect(" "));
				stream.write(&buf[..]).unwrap();
		});
	}
}
<commit_msg>chore(*): update deprecated connect -> join<commit_after>use std::io::Write;
use std::io::Read;
use std::net::TcpListener;
use std::thread;

extern crate xdr;

fn main() {
	let listener = TcpListener::bind("127.0.0.1:9123").unwrap();
	println!("listening started, ready to accept");
	for stream in listener.incoming() {
		thread::spawn(|| {
				let mut stream = stream.unwrap();
				let mut data = [0u8;36];
				let _ = stream.read(&mut data);

				let mut strs : Vec<String>= data.iter().map(|b| format!("{:02X}", b)).collect();
				println!("{}",strs.join(" "));
				let mut rdr = xdr::xdr::XdrReader::from_array(&data);

				let d_u8 : u8 = rdr.unpack().unwrap();
				let d_i8 : i8 = rdr.unpack().unwrap();
				let d_u16 : u16 = rdr.unpack().unwrap();
				let d_i16 : i16 = rdr.unpack().unwrap();
				let d_u32 : u32 = rdr.unpack().unwrap();
				let d_i32 : i32 = rdr.unpack().unwrap();
				let d_f32 : f32 = rdr.unpack().unwrap();
				let d_f64 : f64 = rdr.unpack().unwrap();

				let mut wr = xdr::xdr::XdrWriter::new();

				wr.pack(d_u8);
				wr.pack(d_i8);
				wr.pack(d_u16);
				wr.pack(d_i16);
				wr.pack(d_u32);
				wr.pack(d_i32);
				wr.pack(d_f32);
				wr.pack(d_f64);

				let buf = wr.into_buffer();
				strs = buf.iter().map(|b| format!("{:02X}", b)).collect();
				println!("{}",strs.join(" "));
				stream.write(&buf[..]).unwrap();
		});
	}
}

{'fraction_non_alphanumeric': 0.22041420118343194, 'fraction_numerical': 0.04437869822485207, 'mean_word_length': 3.4127243066884176, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1029481', 'n_tokens_mistral': 1310, 'n_tokens_neox': 1112, 'n_words': 208}