1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
//! Contains utilities for storing configuration /// Stores configuration pub struct Config { input: String, ignored_passes: Vec<String>, } impl Config { /// Creates a new configuration pub fn new(input: String, ignored_passes: Vec<String>) -> Self { Self { input, ignored_passes, } } /// Returns `true` if the pass is ignored in this `Config` pub fn is_ignored(&self, pass: &str) -> bool { self.ignored_passes.contains(&String::from(pass)) } /// Returns the `input` stored in this `Config` pub fn input(&self) -> &String { &self.input } }