use Cow;
use crateError;
/// Preprocesses the given string and removes all leading and trailing
/// whitespaces. Returns a Cow<'a, str> to avoid unnecessary allocations.
///
/// # Example
/// ```rust
/// use preprocess::prelude::*;
///
/// #[preprocess::sync]
/// #[derive(Debug, Deserialize, Serialize)]
/// pub struct LoginRequest {
/// #[preprocess(trim)]
/// pub email: String,
/// #[preprocess(regex = "^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,}$")]
/// pub password: String,
/// }
/// ```