Skip to main content

check_value

Function check_value 

Source
pub fn check_value<S: Into<String>>(
    condition: bool,
    message: S,
) -> CoreResult<()>
Expand description

Checks if a value is valid

§Arguments

  • condition - The condition to check
  • message - The error message if the condition is false

§Returns

  • Ok(()) if the condition is true
  • Err(CoreError::ValueError) if the condition is false

§Errors

Returns CoreError::ValueError if the condition is false.