Skip to main content

sanitize_input

Function sanitize_input 

Source
pub fn sanitize_input(input: &str) -> String
Expand description

Sanitizes an input string by removing potentially dangerous characters.

This function keeps only alphanumeric characters, whitespace, and a limited set of safe special characters (-, _, ., @). It also trims leading and trailing whitespace.

§Arguments

  • input - The input string to sanitize.

§Returns

A sanitized String.