fxkit 0.1.1

Useful utilities for writting Rust CLI tools
Documentation
1
2
3
4
5
6
7
8
9
10
use std::fs;

pub fn does_file_contain(filepath: &str, text: &str) -> bool {
    let file = match fs::read_to_string(filepath) {
        Ok(f) => f,
        Err(_) => return false,
    };

    file.contains(text)
}