Function create_svg_file_from_hashed_string

Source
pub fn create_svg_file_from_hashed_string<P: AsRef<Path>>(
    string: String,
    path: P,
) -> Result<()>
Expand description

Convenience function to create a new file at the given path and write an icon from a hashed string to it.

§Errors

Among other tings returns an error if a file already exists at the given path

§Examples

use random_icon_lib::create_svg_file_from_hashed_string;
 
let my_string = "Lorem ipsum dolor sit amet...".to_string();
let path_to_new_file = "./tests/new_svg_file.svg";
 
create_svg_file_from_hashed_string(
    my_string,
    path_to_new_file
).unwrap();