replace_in_file

Function replace_in_file 

Source
pub fn replace_in_file(
    file_path: PathBuf,
    replacements: HashMap<&str, &str>,
) -> Result<(), Error>
Expand description

Replaces occurrences of specified strings in a file with new values.

ยงArguments

  • file_path - A PathBuf specifying the path to the file to be modified.
  • replacements - A HashMap where each key-value pair represents a target string and its corresponding replacement string.