MCPcopy Index your code
hub / github.com/eventuallyconsultant/codegenr / call_inner

Method call_inner

codegenr/src/helpers/strings.rs:38–52  ·  view source on GitHub ↗
(
    &self,
    h: &handlebars::Helper<'rc>,
    _: &'reg handlebars::Handlebars<'reg>,
    _: &'rc handlebars::Context,
    _: &mut handlebars::RenderContext<'reg, 'rc>,
  )

Source from the content-addressed store, hash-verified

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/// ```

Callers

nothing calls this directly

Calls 10

is_json_emptyFunction · 0.85
get_param_as_strMethod · 0.80
trim_charMethod · 0.80
trim_start_charMethod · 0.80
trim_end_charMethod · 0.80

Tested by

no test coverage detected