summaryrefslogtreecommitdiffstats
path: root/examples/dmtx_svg.rs
blob: 5a3915a4b10f1827a3bfde36c6086fbd0417fece (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use iec16022::DataMatrix;
use std::env::args_os;
use std::os::unix::ffi::OsStringExt;

fn main() {
    let data = args_os()
        .skip(1) // program name
        .map(|arg| arg.into_vec())
        .collect::<Vec<_>>()
        .join(&b' ');
    let dmtx = DataMatrix::encode(&data).unwrap();

    print!("{}", dmtx.svg());
}