[][src]Function rubric::helpers::fs::file_contains

pub fn file_contains<P: AsRef<Path>>(path: P, needle: &str) -> bool

Returns true if a file contains the provided string

Warning: if the file couldn't be read from (doesn't exist, invalid permission, etc), this function will return false, not panic!

use rubric::helpers::fs;

assert!(fs::file_contains("Cargo.toml", "version"));