<commit_before>extern crate clap;
#[macro_use] extern crate log;
extern crate env_logger;
extern crate mio;

extern crate simplesched;

use clap::{Arg, App};

use mio::buf::RingBuf;

use simplesched::Scheduler;
use simplesched::net::udp::UdpSocket;

fn main() {
    env_logger::init().unwrap();

    let matches = App::new("udp-echo")
            .version(env!("CARGO_PKG_VERSION"))
            .author("<NAME> <<EMAIL>>")
            .arg(Arg::with_name("BIND").short("b").long("bind").takes_value(true).required(true)
                    .help("Listening on this address"))
            .arg(Arg::with_name("THREADS").short("t").long("threads").takes_value(true)
                    .help("Number of threads"))
            .get_matches();

    let bind_addr = matches.value_of("BIND").unwrap().to_owned();

    Scheduler::spawn(move|| {
        let addr = bind_addr.parse().unwrap();
        let server = UdpSocket::bound(&addr).unwrap();

        info!("Listening on {:?}", server.local_addr().unwrap());

        let mut buf = RingBuf::new(1024);

        loop {
            let peer_addr = server.recv_from(&mut buf).unwrap().unwrap();
            info!("Accept connection: {:?}", peer_addr);

            server.send_to(&mut buf, &peer_addr).unwrap();
        }
    });

    Scheduler::run(matches.value_of("THREADS").unwrap_or("1").parse().unwrap());
}<commit_msg>fixed compile error<commit_after>extern crate clap;
#[macro_use] extern crate log;
extern crate env_logger;
extern crate mio;

extern crate simplesched;

use std::net::SocketAddr;

use clap::{Arg, App};

use simplesched::Scheduler;
use simplesched::net::udp::UdpSocket;

fn main() {
    env_logger::init().unwrap();

    let matches = App::new("udp-echo")
            .version(env!("CARGO_PKG_VERSION"))
            .author("<NAME> <<EMAIL>>")
            .arg(Arg::with_name("BIND").short("b").long("bind").takes_value(true).required(true)
                    .help("Listening on this address"))
            .arg(Arg::with_name("THREADS").short("t").long("threads").takes_value(true)
                    .help("Number of threads"))
            .get_matches();

    let bind_addr = matches.value_of("BIND").unwrap().to_owned();

    Scheduler::spawn(move|| {
        let addr: SocketAddr = bind_addr.parse().unwrap();
        let server = UdpSocket::bind(&addr).unwrap();

        info!("Listening on {:?}", server.local_addr().unwrap());

        let mut buf = [0u8; 1024];

        loop {
            let (len, peer_addr) = server.recv_from(&mut buf).unwrap();
            info!("Accept connection: {:?}", peer_addr);

            server.send_to(&mut buf[..len], &peer_addr).unwrap();
        }
    });

    Scheduler::run(matches.value_of("THREADS").unwrap_or("1").parse().unwrap());
}
{'fraction_non_alphanumeric': 0.18419144307469182, 'fraction_numerical': 0.00435097897026831, 'mean_word_length': 3.0160116448326053, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '7290849', 'n_tokens_mistral': 891, 'n_tokens_neox': 874, 'n_words': 151}