You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: ssr.rs
    path of file: ./repos/rust-analyzer/crates/rust-analyzer/src/cli
    
    the code of the file until where you have to start completion: //! Applies structured search replace rules from the command line.

use anyhow::Context;
use ide_ssr::MatchFinder;
use load_cargo::{load_workspace_at, LoadCargoConfig, ProcMacroServerChoice};
use project_model::{CargoConfig, RustLibSource};

use crate::cli::flags;

impl flags::Ssr {
    pub fn run(self) -> anyhow::Result<()> {
        use ide_db::base_db::SourceDatabaseExt;
        let cargo_config =
            CargoConfig { sysroot: Some(RustLibSource::Discover), ..Default::default() };
        let load_cargo_config = LoadCargoConfig {
            load_out_dirs_from_check: true,
            with_proc_macro_server: ProcMacroServerChoice::Sysroot,
            prefi
    
    pub fn run(self) -> anyhow::Result<()> {
        use ide_db::base_db::SourceDatabaseExt;
        let cargo_config =
            CargoConfig { sysroot: Some(RustLibSource::Discover), ..Default::default() };
        let load_cargo_config = LoadCargoConfig {
            load_out_dirs_from_check: true,
            with_proc_macro_server: ProcMacroServerChoice::Sysroot,
            prefill_caches: false,
        };
        let (ref db, vfs, _proc_macro) = load_workspace_at(
            &std::env::current_dir()?,
            &cargo_config,
            &load_cargo_config,
            &|_| {},
        )?;
        let mut match_finder = MatchFinder::at_first_file(db)?;
        for rule in self.rule {
            match_finder.add_rule(rule)?;
        }
        let edits = match_finder.edits();
        for (file_id, edit) in edits {
            if let Some(path) = vfs.file_path(file_id).as_path() {
                let mut contents = db.file_text(file_id).to_string();
                edit.apply(&mut contents);
                std::fs::write(path, contents)
                    .with_context(|| format!("failed to write {path}"))?;
            }
        }
        Ok(())
    }