Skip to content

Commit a5dba9b

Browse files
authored
Merge pull request #19649 from github/redsun82/rust-has-implementation
Rust: extract `hasImplementation` on functions and consts
2 parents e30a9e9 + b102d5c commit a5dba9b

File tree

20 files changed

+14566
-18
lines changed

20 files changed

+14566
-18
lines changed

misc/codegen/templates/rust_classes.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ pub struct {{name}} {
6363

6464
impl {{name}} {
6565
{{#detached_fields}}
66-
pub fn emit_{{singular_field_name}}(id: trap::Label<Self>, {{#is_repeated}}{{^is_unordered}}i: usize, {{/is_unordered}}{{/is_repeated}}value: {{base_type}}, out: &mut trap::Writer) {
67-
out.add_tuple("{{table_name}}", vec![id.into(), {{#is_repeated}}{{^is_unordered}}i.into(), {{/is_unordered}}{{/is_repeated}}value.into()]);
66+
pub fn emit_{{singular_field_name}}(id: trap::Label<Self>{{^is_predicate}}{{#is_repeated}}{{^is_unordered}}, i: usize{{/is_unordered}}{{/is_repeated}}, value: {{base_type}}{{/is_predicate}}, out: &mut trap::Writer) {
67+
out.add_tuple("{{table_name}}", vec![id.into(){{^is_predicate}}{{#is_repeated}}{{^is_unordered}}, i.into(){{/is_unordered}}{{/is_repeated}}, value.into(){{/is_predicate}}]);
6868
}
6969
{{/detached_fields}}
7070
}

0 commit comments

Comments
 (0)