ferment-sys 0.2.14

Syntax tree morphing of FFI-compatible stuff
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use quote::ToTokens;
use syn::__private::TokenStream2;
use crate::ext::WrapIntoRoundBraces;

pub trait MethodCall {
    fn method(&self) -> TokenStream2;
    fn expr(&self) -> TokenStream2;
}

impl ToTokens for dyn MethodCall {
    fn to_tokens(&self, dst: &mut TokenStream2) {
        self.method().to_tokens(dst);
        WrapIntoRoundBraces::wrap(self.expr()).to_tokens(dst);
    }
}