Skip to content

Macro to clone variables for use in e.g. closures without cluttering your program with extra parentheses or brackets. Uses proc-macro to get attribute-style syntax.

License

Notifications You must be signed in to change notification settings

selenologist/with-clone-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

with-clone-rs

Rust procedural macro to simplify cloning a variable for closures, blocks, expressions, etc.

Read tests/main.rs for usage examples. N.b. CloneTracker is just used to verify things have been cloned. There is no need to reimplement it in your own code.

Uses procedural macros so that the attribute syntax can be used.

Does not correctly parse the attribute TokenStream, just does the bare minimum to make this work. May produce starnge output in some edge case I've not considered.

MIT License, see LICENSE

About

Macro to clone variables for use in e.g. closures without cluttering your program with extra parentheses or brackets. Uses proc-macro to get attribute-style syntax.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages