Browse Source

make rustc a bit happier

Lucas Stadler 10 years ago
parent
commit
479289db7f
1 changed files with 6 additions and 4 deletions
  1. 6 4
      rust/dpll/cnf.rs

+ 6 - 4
rust/dpll/cnf.rs

@ -12,8 +12,8 @@ use std::io::Read;
12 12
13 13
fn parse_dimac(dimac: &str) {
14 14
    let mut lines = dimac.lines();
15
    let mut num_vars = 0;
16
    let mut num_clauses = 0;
15
    let mut num_vars;
16
    let mut num_clauses;
17 17
    
18 18
    match lines.next() {
19 19
        None => { println!("Error: expected cnf description"); return }
@ -45,6 +45,8 @@ fn parse_dimac(dimac: &str) {
45 45
46 46
fn main() {
47 47
    let input: &mut String = &mut String::new();
48
    io::stdin().read_to_string(input);
49
    parse_dimac(input)
48
    match io::stdin().read_to_string(input) {
49
        Ok(_) => { parse_dimac(input) }
50
        Err(e) => { println!("Error: {}", e) }
51
    }
50 52
}