Skip to content

Support computation in interpolation #10

@sfackler

Description

@sfackler

It's fairly common to have to adjust values you want to interpolate before use, for example: https://github.com/sfackler/rust-postgres-derive/blob/e89a9a5e41cf83539323fe3cae39ece5b4bb685b/postgres-derive-internals/src/fromsql.rs#L90-L92.

It'd be nice if it was possible to "inline" those struct accesses, Ident creation, etc into the interpolation itself. For example, to change

let ident = &foo.ident;
quote!(#ident)

to

quote!(#{foo.ident})

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions