fn let_p_stmt()

in api_generator/src/generator/code_gen/url/url_builder.rs [375:401]


    fn let_p_stmt(url_ident: syn::Ident, len_expr: syn::Expr) -> syn::Stmt {
        let string_with_capacity = syn::ExprKind::Call(
            Box::new(
                syn::ExprKind::Path(None, {
                    let mut method = path_none("String");
                    method
                        .segments
                        .push(syn::PathSegment::from("with_capacity"));
                    method
                })
                .into(),
            ),
            vec![len_expr],
        )
        .into();

        syn::Stmt::Local(Box::new(syn::Local {
            pat: Box::new(syn::Pat::Ident(
                syn::BindingMode::ByValue(syn::Mutability::Mutable),
                url_ident,
                None,
            )),
            ty: None,
            init: Some(Box::new(string_with_capacity)),
            attrs: vec![],
        }))
    }