Validate that a string is not empty after trimming. # Arguments `value` - The string to validate. `field_name` - The name of the field for error messages. # Returns `Ok(())` if valid, `Err` if empty.
(value: &str, field_name: &str)
| 48 | /// # Returns |
| 49 | /// `Ok(())` if valid, `Err` if empty. |
| 50 | fn validate_non_empty(value: &str, field_name: &str) -> Result<()> { |
| 51 | if value.trim().is_empty() { |
| 52 | return Err(crate::Error::ConfigInvalid { |
| 53 | message: format!("{field_name} cannot be empty"), |
| 54 | }); |
| 55 | } |
| 56 | Ok(()) |
| 57 | } |
| 58 | |
| 59 | /// Validate that multiple strings are not empty after trimming. |
| 60 | /// |
no test coverage detected