Function hexcrypt::encrypt::parse_size

source ·
fn parse_size(s: &str) -> Result<(u32, u32), HexCryptError>
Expand description

Parses the custom size string into a tuple of width and height.

Arguments

  • s - A reference to the custom size string, e.g., “16x32”.

Errors

This function can return a HexCryptError enum that represents an invalid image size.

Examples

use hexcrypt::parse_size;

match parse_size("16x32") {
    Ok((width, height)) => println!("Parsed size: {}x{}", width, height),
    Err(e) => eprintln!("Error: {:?}", e),
}