/// Helper to render a user role variant via Display trait.
Helper to render a user role variant via Display trait.
Helper to render a user role variant via Display trait .
fn format_user_role(h: &Helper<'_, '_>, out: &mut dyn Output) -> HelperResult {
    // Extract the parameter
    let user_role = h
        // One parameter required.
        .param(0)
        // Parse to user role
        .and_then(|param| serde_json::from_value::<UserRole>(param.value().clone()).ok())
        .ok_or(RenderError::new("format_user_role expects a user's role"))?;
    out.write(user_role.to_string().as_str())?;
    Ok(())
}
fn format_user_role ( h : & Helper < ' _ , ' _ > , out : & mut dyn Output ) -> HelperResult { // Extract the parameter let user_role = h // One parameter required. . param ( 0 ) // Parse to user role . and_then ( | param | serde_json :: from_value :: < UserRole > ( param . value ( ) . clone ( ) ) . ok ( ) ) . ok_or ( RenderError :: new ( " " ) ) ? ; out . write ( user_role . to_string ( ) . as_str ( ) ) ? ; Ok ( ( ) ) }
Helper to render a user role variant via Display trait.
Helper to render a user role variant via Display trait .
h
&Helper<'_, '_>
out
&mut dyn Output