<commit_before>extern crate spidev;

use spidev::ioctl;

// get window size
pub const TIOCGWINSZ: u32 = 0x5413;

#[derive(Clone, Copy, Debug)]
struct Winsize {
    pub ws_row: u16,
    pub ws_col: u16,
    pub ws_xpixel: u16,
    pub ws_ypixel: u16,
}

fn main() {
    // 0 is stdout
    match ioctl::read::<Winsize>(0, TIOCGWINSZ) {
        Ok(winsize) => println!("{:?}", winsize),
        Err(err) => println!("{}", err),
    }
}<commit_msg>ioctl: fix example by adding unsafe block<commit_after>extern crate spidev;

use spidev::ioctl;

// get window size
pub const TIOCGWINSZ: u32 = 0x5413;

#[derive(Clone, Copy, Debug)]
struct Winsize {
    pub ws_row: u16,
    pub ws_col: u16,
    pub ws_xpixel: u16,
    pub ws_ypixel: u16,
}

fn main() {
    // 0 is stdout
    match unsafe { ioctl::read::<Winsize>(0, TIOCGWINSZ) } {
        Ok(winsize) => println!("{:?}", winsize),
        Err(err) => println!("{}", err),
    }
}
{'fraction_non_alphanumeric': 0.162891046386192, 'fraction_numerical': 0.036677454153182305, 'mean_word_length': 3.18018018018018, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6052689', 'n_tokens_mistral': 401, 'n_tokens_neox': 380, 'n_words': 95}