File: parse.rs

package info (click to toggle)
rust-resolv-conf 0.7.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 240 kB
  • sloc: makefile: 4
file content (13 lines) | stat: -rw-r--r-- 326 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::io::Read;
use std::fs::File;

extern crate resolv_conf;


fn main() {
    let mut buf = Vec::with_capacity(4096);
    let mut f = File::open("/etc/resolv.conf").unwrap();
    f.read_to_end(&mut buf).unwrap();
    let cfg = resolv_conf::Config::parse(&buf).unwrap();
    println!("---- Config -----\n{:#?}\n", cfg);
}