use std::{env, fs}; fn main() { let path = env::args() .nth(1) .unwrap_or_else(|| "/sys/firmware/dmi/tables/DMI".to_string()); let data = fs::read(path).unwrap(); for table in dmi::tables(&data) { if let Some(info) = table.get::() { println!("{:?}", info); } else if let Some(info) = table.get::() { println!("{:?}", info); } else if let Some(info) = table.get::() { println!("{:?}", info); } else if let Some(info) = table.get::() { println!("{:?}", info); } else if let Some(info) = table.get::() { println!("{:?}", info); } else if let Some(info) = table.get::() { println!("{:?}", info); } else { println!("Unknown table: {}", table.header.kind); continue; } println!(" strings: {:?}", table.strings); } }