Skip to main content

sanitize_wav_file_name

Function sanitize_wav_file_name 

Source
pub fn sanitize_wav_file_name(file_name: &str) -> Result<String, String>
Expand description

Sanitizes a user/config-supplied IR filename before it is used in a filesystem path.

Accepted filenames must:

  • be non-empty after trimming whitespace,
  • contain no path separators (/, \\) or parent-directory segments (..),
  • end with .wav (case-insensitive).

Returns the trimmed filename on success, or a descriptive Err string.