mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-14 16:37:42 +00:00
templater: generalize merge_fn_map() helper
The global function type is slightly different from method calls.
This commit is contained in:
parent
fa9cb72445
commit
85f2f3a439
1 changed files with 1 additions and 4 deletions
|
@ -262,10 +262,7 @@ pub struct CoreTemplateBuildFnTable<'a, L: TemplateLanguage<'a> + ?Sized> {
|
|||
// TODO: add global functions table?
|
||||
}
|
||||
|
||||
pub fn merge_fn_map<'a, L: TemplateLanguage<'a> + ?Sized, T>(
|
||||
base: &mut TemplateBuildMethodFnMap<'a, L, T>,
|
||||
extension: TemplateBuildMethodFnMap<'a, L, T>,
|
||||
) {
|
||||
pub fn merge_fn_map<'s, F>(base: &mut HashMap<&'s str, F>, extension: HashMap<&'s str, F>) {
|
||||
for (name, function) in extension {
|
||||
if base.insert(name, function).is_some() {
|
||||
panic!("Conflicting template definitions for '{name}' function");
|
||||
|
|
Loading…
Reference in a new issue