sat-rs 0.0.3

A SAT solver written in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::io::Read;

pub fn read_file(path: &std::path::PathBuf) -> String {
    let mut buffer = String::new();

    let mut file = match std::fs::File::open(path) {
        Err(why) => panic!("couldn't open {}: {}", path.display(), why),
        Ok(file) => file,
    };

    match file.read_to_string(&mut buffer) {
        Err(why) => panic!("couldn't read {}: {}", path.display(), why),
        Ok(_) => (),
    }

    buffer
}