pub fn validate_string<S: Into<String>>(input: S, param_name: &str) -> StdResult<String> {
    let s: String = input.into();
    if s.trim().is_empty() {
        let errm = format!("{} must not be empty", param_name);
        Err(StdError::generic_err(errm))
    } else {
        Ok(s)
    }
}
/// A helper that ensures string params are non-empty.
A helper that ensures string params are non-empty.
A helper that ensures string params are non - empty .
pub fn validate_string<S: Into<String>>(input: S, param_name: &str) -> StdResult<String> {
    let s: String = input.into();
    if s.trim().is_empty() {
        let errm = format!("{} must not be empty", param_name);
        Err(StdError::generic_err(errm))
    } else {
        Ok(s)
    }
}
pub fn validate_string < S : Into < String > > ( input : S , param_name : & str ) -> StdResult < String > { let s : String = input . into ( ) ; if s . trim ( ) . is_empty ( ) { let errm = format ! ( " " param_name ) ; Err ( StdError :: generic_err ( errm ) ) } else { Ok ( s ) } }
A helper that ensures string params are non-empty.
A helper that ensures string params are non - empty .
input
S
param_name
&str
input
S
param_name
&str