Skip to main content

finish_instance_body

Function finish_instance_body 

Source
fn finish_instance_body(
    lines: &mut Vec<String>,
    method: &TraitMethod,
    receiver: &str,
)
Expand description

Close an instance-method body (#1213).

A void method hands back its receiver (x / self) so calls chain under the pipe; the receiver is returned visibly, like every other return. A method whose declared return is Invisible<..> wraps its final expression (the receiver, or the converted .val / classed value) in invisible().