(
&self,
h: &handlebars::Helper<'rc>,
_: &'reg handlebars::Handlebars<'reg>,
_: &'rc handlebars::Context,
_: &mut handlebars::RenderContext<'reg, 'rc>,
)
| 36 | fn call_inner<'reg: 'rc, 'rc>( |
| 37 | &self, |
| 38 | h: &handlebars::Helper<'reg, 'rc>, |
| 39 | _: &'reg handlebars::Handlebars<'reg>, |
| 40 | _: &'rc handlebars::Context, |
| 41 | _: &mut handlebars::RenderContext<'reg, 'rc>, |
| 42 | ) -> Result<handlebars::ScopedJson<'reg, 'rc>, handlebars::RenderError> { |
| 43 | h.ensure_arguments_count_min(1, TRIM_HELPER)?; |
| 44 | h.ensure_arguments_count_max(2, TRIM_HELPER)?; |
| 45 | |
| 46 | let to_trim = h.get_param_as_str_or_fail(0, TRIM_HELPER)?.to_string(); |
| 47 | let trimmer = h.get_param_as_str(1).map(|s| s.to_string()); |
| 48 | |
| 49 | Ok(Value::String(to_trim.trim_char(trimmer)).into()) |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | /// Return the first part of a String splited by a definable parameter ('/' by default) |
| 54 | /// |
| 55 | /// ``` |
nothing calls this directly
no test coverage detected