INNER CODE UNIT · Rust

handle_error_and_exit

Drew-Alleman/DataSurgeon · src/utils/mod.rs:48

pub fn handle_error_and_exit(error_message: &str) {
    println!("[-] Error: {}", error_message);
    if yn_prompt("Do you want to exit? (y/n): ") {
        std::process::exit(1);
    }
}

/// Normalizes a URL string by converting it to lowercase, 
/// removing any 'http://' or 'https://' prefixes, and trimming trailing slashes.
///
/// # Arguments
///
/// * `url` - A string slice that holds the URL to be normalized.
///
/// # Example
///
/// ```
/// let url = "HTTP://www.Example.com/";

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…