Function run

Source
pub fn run(config: Config) -> Result<(), Box<dyn Error>>
Expand description

Runs the search based on the provided configuration.

§Arguments

  • config - A Config struct containing the query, filename, and case sensitivity flag.

§Returns

  • Result<(), Box<dyn Error>> - Returns Ok(()) if successful, or an error if something goes wrong.

§Examples

use quewuigrep::{Config, run};
use std::env;
 
let args: Vec<String> = vec!["program".into(), "query".into(), "filename.txt".into()];
let config = Config::new(&args).unwrap();
run(config).unwrap();